+ Reply to Thread
Results 1 to 8 of 8

Thread: QT static build

  1. #1

    Default QT static build

    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.p..._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

    Thanks all!

  2. #2
    Join Date
    May 2010
    Location
    Romania->Arad;
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT static build

    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 (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 (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

  3. #3

    Default Re: QT static build

    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?

  4. #4

    Default Re: QT static build

    I get the error when I try to run > configure.exe -static -release:


    Perl not found in environment - cannot run syncqt.

    Any ideas why?

  5. #5
    Join Date
    May 2010
    Location
    Romania->Arad;
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT static build

    You need to install ActivePerl and add it to path, also see other requirements to build Qt on Windows here (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.

  6. #6

    Default Re: QT static build

    OK, this was working so far... during compilation, an error occured... Some OpenGL-Path was not found ((

    Any ideas!?!

  7. #7
    Join Date
    May 2010
    Location
    Romania->Arad;
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT static build

    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.

  8. #8

    Default Re: QT static build

    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

+ Reply to Thread

Similar Threads

  1. Build static QT + static SSL problem.
    By makzimi in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2012, 23:45
  2. configure qt, static build
    By terhje in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2012, 18:49
  3. Replies: 1
    Last Post: 13th January 2010, 23:35
  4. Moving from QT 4.5 shared build to QT 4.5.2 static build
    By extrakun in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 09:49
  5. Can i build a static exe?
    By coder1985 in forum Qt Programming
    Replies: 3
    Last Post: 11th June 2008, 16:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts