Qt - static build



  • I've seen many articles and instructions about building Qt statically. But anyway I get errors during this process.

    OS: Windows 8, x64
    I've installed Perl, Python, Ruby, they are at PATH variable too.
    Also installed Visual Studio 2010, Windows SDK 7.1, Visual Studio 2010 SP1, Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1 (as described here http://qt-project.org/wiki/Building-Qt-5-from-Git)

    Then, using Windows SDK Command Prompt I do:
    @configure -prefix % cd%\qtbase -opensource -static -platform win32-msvc2010 -nomake tests -nomake examples@

    and then:
    @nmake@

    It compiles some files (nearly 30 min) and then:
    @ link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "
    /MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' versio
    n='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture
    ='
    '" /MANIFEST /MANIFESTFILE:C:\Qt-static\qtbase\bin\qmlscene.exe.embed.manifes
    t /OUT:C:\Qt-static\qtbase\bin\qmlscene.exe @C:\Users\D395~1\AppData\Local\Temp
    nmAAB9.tmp
    LINK : fatal error LNK1181: cannot open input file 'Files.obj'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\Bin\link.EXE"' : return code '0x49d'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\Bin\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.@
    What to do? Or how to build Qt statically and correctly?


  • Moderators

    This is how I build Qt4 statically:
    @
    ./configure -prefix $PWD -nomake demos -nomake examples -nomake tests -release -static -no-exceptions -no-webkit -qt-zlib -qt-libpng -qt-libjpeg -arch x86 -dont-process -no-qt3support

    bin/qmake projects.pro QT_BUILD_PARTS="libs" JAVASCRIPTCORE_JIT="yes"

    make -j5
    @

    AFAIK, in Qt5 QtQuick is causing problems during static compilation. Be sure to grab newest sources (Qt 5.1, or git dev branch).



  • It seems building Qt5 statically has a lot of issues.

    For one thing setting the -platform to win32-msvc2012 has no effect; it reverts to win32-msvc2010.

    For this specific issue, I've found the issue is related to the DirectX libraries. When installing the directX SDKs it installs to some location like:
    C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)

    If you look at the Makefile in qmlscene you'll see that path and then several incomplete paths like 2010)\Lib\blah.lib. If you copy the DirectX libraries to a location without spaces, then replace all the directX paths in the Makefile with the new path and take out 1 errant floating path (it is ~2010)\Lib with no .lib attached to it), it should compile. You'll have to repeat the process for each Makefile that has the wrong path-names.

    Basically somewhere in Qt it doesn't replace the paths properly with the directX library path (and it can't handle spaces).

    I'm sure there is a way to automate fix it without having to modify each Makefile, but I haven't found it yet.


  • Moderators

    Please "report this":https://qt-project.org/wiki/ReportingBugsInQt. Qt Project is working hard on getting Qt5 to compile in static, but there are hurdles, mostly in QtQuick2.






Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.