Trying to build up Qt with static linking on windows via mingw+jom vs VS2012 & constantly getting it crashed, please help



  • Trying to build the static qt but frequently getting tons of issues. I have qt-win-opensource-4.8.4-mingw & qt-everywhere-opensource-src-5.2. Tried to compile both in mingw and vs2012 Here is what i'm doing:

    For 4.8.4:

    1. Edited the flags in C:\Qt\4.8.4\mkspecs\win32-msvc2012\qmake.conf to static:

    QMAKE_CFLAGS_RELEASE = -O2 -MT
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MTd

    1. In the windows command prompt run this:

    configure -debug-and-release -opensource -platform win32-msvc2012 -opengl desktop -static -nomake examples -nomake tests

    1. The qt successfully configured, and i tried to build it via jom:

    C:\Qt\jom\jom.exe

    and got this:

    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qisciicodec.o] Error 1
    In file included from c:/Qt/4.8.4/src/corelib/codecs/qtsciicodec.cpp:46:0:
    c:/Qt/4.8.4/src/corelib/codecs/qtsciicodec_p.h:85:31: ЇрЄры№эр  ю°шсър: QtCore/q
    textcodec.h: No such file or directory
    ъюьяшы Ўш  яЁхЁтрэр.
    c:/Qt/4.8.4/src/corelib/global/qglobal.cpp:42:27: ЇрЄры№эр  ю°шсър: qplatformdef
    s.h: No such file or directory
    ъюьяшы Ўш  яЁхЁтрэр.
    c:/Qt/4.8.4/src/corelib/global/qmalloc.cpp:42:27: ЇрЄры№эр  ю°шсър: qplatformdef
    s.h: No such file or directory
    ъюьяшы Ўш  яЁхЁтрэр.
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qglobal.o] Error 1
    In file included from c:/Qt/4.8.4/src/corelib/codecs/qutfcodec.cpp:42:0:
    c:/Qt/4.8.4/src/corelib/codecs/qutfcodec_p.h:56:31: ЇрЄры№эр  ю°шсър: QtCore/qte
    xtcodec.h: No such file or directory
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qmalloc.o] Error 1
    ъюьяшы Ўш  яЁхЁтрэр.
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qtsciicodec.o] Error 1
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qutfcodec.o] Error 1
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qlatincodec.o] Error 1
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qsimplecodec.o] Error 1
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile.Release [tmp\obj\release_s
    tatic\qtextcodec.o] Error 1
    jom: C:\Windows\System32\src\tools\bootstrap\Makefile [release] Error 2
    jom: C:\Windows\system32\Makefile [sub-tools-bootstrap-make_default-ordered] Err
    or 2

    For 5.2:

    1. Edited the flags in C:\Qt\5.2\qtbase\mkspecs\win32-msvc2012\qmake.conf to static:

    QMAKE_CFLAGS_RELEASE = -O2 -MT
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MTd

    1. In the windows command command run:

    set QMAKESPEC=win32-msvc2012%PATH%
    set QTDIR=C:\Qt\5.2\qtbase%PATH%
    set PATH=C:\Qt\5.2\qtbase\bin;%PATH%

    then:

    configure -debug-and-release -opensource -platform win32-msvc2012 -opengl desktop -static -nomake examples -nomake tests

    3 Got this:

    C:\Windows\System32>configure -debug-and-release -opensource -platform win32-msv
    c2012 -opengl desktop -static -nomake examples -nomake tests
    "C:\Qt\5.2\qtbase\configure.exe" isn't recognized as an internal or external command.

    My path variable:

    C:\Qt\5.2\qtbase\mkspecs\win32-msvc2012;C:\Qt\5.2;C:\Qt5.2\qtbase\bin;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin;C:\Qt\4.8.5\plugins\sqldrivers;C:\Qt\4.8.5;C:\Qt\4.8.5\bin;C:\Qt\4.8.4;C:\Qt\4.8.4\bin;C:\MinGW\msys\1.0\bin;C:\MinGW\msys\1.0\bin;C:\MinGW\msys\1.0;C:\MinGW;C:\MinGW\bin;C:\MinGW\mingw32\bin;C:\MinGW\mingw32;C:\Python33;C:\Perl64\site\bin;C:\Perl64\bin;C:\Windows\sys;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0%PATH%

    Do i need windows sdk or directx sdk or anything else? Is there any chance to get it compiled? Kindly help me, any tips would be highly appreciated.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Don't put Qt in your PATH environment variable, it will not help and might even make things worse when building on Windows. You don't need to set all these variable and specially you should not append PATH to all of them. Also, why are you calling configure in C:\Windows\System32 ?



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