first, sorry for my probably stupid questions (although this place is for newbies anyway).
I am new to qt and c++.

I use qt with mingw.
I re-compileded qt libs statically for some reasons.
(question 1:) now, isnt exists a way to compile some progs dynamically with this recompiled qt? I ran configure and make commands directly in my qt directory. now I cant make dynamically linked exe files even by specifying explicit dynamic linking options, but no errors and not even one warning are reported and static exes are generated instead of dynamic options.
I first compiled for static libs by -static option to configure and then ran make (build process took several hours on my PIII system).
That way qt libs were statically linked but I saw that mingw10.dll wasnt yet statically linked.
So then again, according to articles I found on the web, I modified <qt dir>\mkspecs\win32-g++\qmake.conf and added -static to QMAKE_LFLAGS within it. And I ran 'configure -static -release -no-exceptions' and make (mingw32-make).
This time my exe files became fully static, apparently. they can be ran alone, and of course, have a considerable size.
I want to know some things. e.g. (question 2:) why I needed a recompilation on the whole qt for linking to mingw10.dll statically whereas mingw10.dll is from a seperate toolkit not belonging to qt; what is the job that qmake.conf and -static in QMAKE_LFLAGS do in these scenarios.
(question 3:) what -no-exceptions does and why is needed and what limits it create for qt (or my c++ compilations in general?) apps?

(for another question) I have a test prog:

Qt Code:
  1. #include <QApplication>
  2. #include <QPixmap>
  3. #include <QPushButton>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication app(argc, argv);
  8.  
  9. (new QPushButton())->show(); //only to let the user exit from app conveniently.
  10.  
  11. QPixmap img=QPixmap(500,500);
  12. img.save("result.png", "png");
  13.  
  14. return app.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

it is working.
but indeed I wanted to save in jpg format:
Qt Code:
  1. #include <QApplication>
  2. #include <QPixmap>
  3. #include <QPushButton>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication app(argc, argv);
  8.  
  9. (new QPushButton())->show(); //only to let the user exit from app conveniently.
  10.  
  11. QPixmap img=QPixmap(500,500);
  12. img.save("result.jpg", "jpg");
  13.  
  14. return app.exec();
  15. }
To copy to clipboard, switch view to plain text mode 
this can be compiled with my static qt but the resulted jpg file is an empty file (0 bytes).
now I add every other thing found regarding this to my project:

Qt Code:
  1. #include <QApplication>
  2. #include <QPixmap>
  3. #include <QPushButton>
  4.  
  5. #include <QtPlugin>
  6. Q_IMPORT_PLUGIN(qjpeg)
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QApplication app(argc, argv);
  11.  
  12. (new QPushButton())->show(); //only to let the user exit from app conveniently.
  13.  
  14. QPixmap img=QPixmap(500,500);
  15. img.save("result.jpg", "jpg");
  16.  
  17. return app.exec();
  18. }
To copy to clipboard, switch view to plain text mode 
and:
Qt Code:
  1. QTPLUGIN += qjpeg
To copy to clipboard, switch view to plain text mode 
goes in the .pro file.

But finally I get g++ compile error: release/main.o:main.cpp:(.text+0x119): undefined reference to `qt_plugin_instance_qjpeg()'
I get this error both with static qt libs and dynamic qt libs (BTW I have two near versions of qt on my system installed separately).

indeed first I wrote a jpg working prog (dynamically linked) that worked nice on my system; but when I ran it on another system that qt wasnt installed on, created jpg files became empty. I accompanied all the dlls that my prog demanded (qtgui, qtcore, mingw10.dll) and finally also qjpeg4.dll. but prog simply didnt work as expected, without giving any reason for that.
so I decided to test a fully static prog and recompiled qt (...other parts of the story that you read from above).

please help me!!