Why is my basic program 178 megs in size
-
You don't need to compile Qt libraries. They already exist on your hdd through QtSDK and are located in .../QtSDK/Desktop/Qt/4.7.3/mingw/bin directory. Note that are named without d (not QtCored). Also you need to compile your application in release mode. If you are using QtCreator, goto in Project tab, and choose from "Edit build configuration" your mingw release configuration. If you use qmake, qmake.exe yourproject.pro -r -spec win32-g++ "CONFIG+=release"
-
If you use Qt Creator, in the lower left corner there is button with this settings, or just add to your Project.pro file
@CONFIG += release@ -
You can try "static":http://doc.qt.nokia.com/latest/deployment-windows.html compilation as well.
-
[quote author="Rahul Das" date="1311759984"]You can try "static":http://doc.qt.nokia.com/latest/deployment-windows.html compilation as well. [/quote]
Be careful with static compilation. First of all, there are no static libs provided by default so you would have to create them. Second, there are some license issues on that, e.g. AFAIK closed source with LGPL might not use static libs.
-
[quote author="cincirin" date="1311752501"]You don't need to compile Qt libraries. They already exist on your hdd through QtSDK and are located in .../QtSDK/Desktop/Qt/4.7.3/mingw/bin directory. Note that are named without d (not QtCored). Also you need to compile your application in release mode. If you are using QtCreator, goto in Project tab, and choose from "Edit build configuration" your mingw release configuration. If you use qmake, qmake.exe yourproject.pro -r -spec win32-g++ "CONFIG+=release"[/quote]
when i am compiling my program, how not to compile the Qt libraries?
-
If you did not, make sure you have removed all Qt modules you don't need from your project.
From MSVC menu: Qt > Qt project Settings > Qt Modules, tab. (if you have the MSVC addin installed, wihich I strongly recommend for you).What was said before was not about your code compilation it is about the Qt you are using.
Explaining: you have to compile Qt yourself, i.e. put away the one you downloaded and build another Qt for you from src code, using Visual Studio in your case, for static build. This Qt will generate a single .exe that will be self-contained. I never compiled the static version, but just in case you don't know:
-Qt compilation have to be configured correctly as Visual Studio compliant, static build,etc. (search the forum or google it)
-Qt compilation may/will take some time (hours)
-As mentioned above, there might be license restrictions to your software -
the static version seems a bit complicated only to get a smaller program size at compilation and without the dlls i am assuming. When you say self-contained, are you saying that the dlls are inside of the exe file? Also, the possible license restrictions i do not like. I will stay with my downloadable qt version.
Will there be license restrictions if i use the downloadable qt version to compile my program?
I don't think I have the MSVC addin installed because there is no MSVC menu in the qt creator.
-
Started a new topic "here":http://developer.qt.nokia.com/forums/viewthread/8219/ about licensing.
-
[quote author="Rahul Das" date="1311840634"]Started a new topic "here":http://developer.qt.nokia.com/forums/viewthread/8219/ about licensing. [/quote]
There are many such topics already. Please use the search option, and refer to them first.
-
If you are going to use visual studio to generate your code, you can download the msvc addin "here":http://qt.nokia.com/downloads/visual-studio-add-in. Then you will have some menus for Qt inside visual studio. Otherwise (MinGW), forget it :-)