PDA

View Full Version : QT static build



brasco2k9
7th February 2013, 21:17
Hi guys,

I would like to know if there is any manual explaining me how to make a static build. I have tried many tutorials, especially this one here...

http://www.qtcentre.org/wiki/index.php?title=Building_static_Qt_on_Windows

It starts with the <QTDIR>\qmake\Makefile.win32* which I don't have. I tried with Qt 5.0.1 for Windows 32-bit (MinGW 4.7, 823 MB) and an older installation on a different machine, QT 4.8.4. I'm using QT under windows.

I am new to this, hopefully somebody has some way, even if I have to reinstall QT, I really need to make a static build :D

Thanks all!

Zlatomir
8th February 2013, 08:48
My recommendation is to start with the source code if you want to build Qt yourself (static or not) so start with download the source code from here (http://qt-project.org/downloads) (for Qt 5 you need the .zip file because that is the one that has configure.exe - i see you are on windows platform). //disclaimer: i didn't built Qt5, only Qt4 but i really expect it to build as simple as 4.

And after you download the source code you extract the zip file and than:
- you run configure.exe (from the cmd that has the variables set for the compiler you want to use - Visual Studio has a shortcut in start menu - MinGW should has one too - or maybe you need to add some paths - use a search engine to find more information) with all the flags you need example: -static look in the documentation for the flags you can use in configure, here (http://doc.qt.digia.com/stable/configure-options.html) (the link is for Qt4 you search Qt5 documentation if you want to build Qt5).
- you run nmake (if you use Visual Studio) or mingw32-make (if you use MinGW) //additionally you can use make sub-src that wont build examples and other stuff (you will probably need to run make sub-tools after the frameworks build finishes - again search a little, i'm not sure the sub-tools is correct - that's to build the designer and linguist)

Those are my advices, hope it helps ;)

brasco2k9
8th February 2013, 11:42
hi, thanks so far for your explanation. I think this is a part of the tutorial I posted above, what I'm wondering about is you do not change anything neither in mkspecs (a folder I have) nor in \qmake\Makefile.win32* files (which I do not have).

Does this result in a working build?

brasco2k9
9th February 2013, 09:59
I get the error when I try to run > configure.exe -static -release:


Perl not found in environment - cannot run syncqt.

Any ideas why?

Zlatomir
9th February 2013, 11:59
You need to install ActivePerl and add it to path, also see other requirements to build Qt on Windows here (http://qt-project.org/doc/qt-5.0/qtdoc/requirements-win.html) (the link is for Qt 5 - if you try to build Qt 4 search in documentation for it's requirements)

I didn't had to edit mkspecs // that is to eliminate (read also static link) the dependency of vc++ run-time dlls.

brasco2k9
9th February 2013, 12:19
OK, this was working so far... during compilation, an error occured... Some OpenGL-Path was not found :(((

Any ideas!?!

Zlatomir
9th February 2013, 13:11
I guess you try to build Qt 5.
Did you installed all the requirements? OpenGL files should be present in Windows SDK and you also need the DirectX SDK if you use Angle (this is default).

Also make sure that you run nmake distclean (if you use VS or mingw's make if you use mingw) before/if you run configure again and also share more details, i still don't know if you try to build Qt 5 or 4 or if you use Visual Studio or MinGW.

brasco2k9
9th February 2013, 13:34
Thank you very much for your reply!

I try to build Qt5 and I use MinGW.

I have written some analysis tool in C++, running in console only. I do not need anything else. I think we're coming closer :)