How to build Qt510 static version on Win7?



  • Any body who please give me some instructions on how to build Qt510 static on Win7.

    I would like to build app without needing with deploying a lot of Qt**.dll.
    I found on wiki that I must build a static version QT510 by myself.

    I am using a Win7(x64) and have installed VS2012 express and Windows SDK for Windows 8
    I also download
    qt-windows-opensource-5.1.0-msvc2012_opengl-x86_64-offline.exe
    and
    qt-everywhere-opensource-src-5.1.0.zip

    If I want to rebuild QT510 static version, which source I should choose?
    And the thing most bothers me is I cannot select the input option of configure tool.

    Please help me, the most welcomed answer is give me the detail steps and command line input.

    Thank you.


  • Moderators

    Please mind the licensing problems while using static build of Qt. .exe package contains precompiled libraries - that is not what you need.

    You need to extract the ZIP archive, then browse to the folder in cmd.exe and type:
    @
    configure -prefix "./qtbase" -static
    nmake sub-src
    @



  • Why this prompt

    bq. NMAKE : fatal error U1073: don't know how to make 'sub-src'

    I use the cmd window as below, or else I cannot find nmake in my env.

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools\Developer Command Prompt for VS2012.lnk


  • Moderators

    OK, delete the last one, extract again, and now let's try the old Qt4 way:
    @
    configure -developer-build -static -dont-process
    qtbase/bin/qmake projects.pro QT_BUILD_PARTS="libs" JAVASCRIPTCORE_JIT="yes"
    nmake
    @



  • Yes, I found that only nmake is working

    @
    configure -prefix "./qtbase" -static
    nmake @

    I will first wait it for finishing, and then try the Qt4 way.

    Thank you slerdzlo.
    Thank you very much.

    I will give my feedback.


  • Moderators

    You can also try without -prefix or -developer-build. I always add it because I'm running multiple Qt versions in parallel. But if you only want one single Qt installation, you can skip those flags (but then you need to run "nmake install" as an additional step at the end).



  • Oh, I have met the problem below ,
    twice.

    @bq. include" -I"........\include\QtWidgets" -I"........\include\QtGui" -I"...
    .....\include\QtANGLE" -I"........\include\QtCore" -I".moc\debug_static" -I
    "........\mkspecs\win32-msvc2012" -Fo.obj\debug_static\ @C:\Users\HY001354\Ap
    pData\Local\Temp\nmC18F.tmp
    moc_languagechooser.cpp
    moc_mainwindow.cpp
    Generating Code...
    echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST / "de
    bug\i18n.exe.embed.manifest">debug\i18n.exe_manifest.rc
    if not exist debug\i18n.exe if exist debug\i18n.exe.embed.manifest del d
    ebug\i18n.exe.embed.manifest
    if exist debug\i18n.exe.embed.manifest copy /Y debug\i18n.exe.embed.mani
    fest debug\i18n.exe_manifest.bak
    link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFEST
    DEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.
    0' publicKeyToken='6595b64144ccf1df' language='
    ' processorArchitecture='*'" /MA
    NIFEST /MANIFESTFILE:debug\i18n.exe.embed.manifest /OUT:debug\i18n.exe @C:\Users
    \HY001354\AppData\Local\Temp\nmCA75.tmp
    Creating library debug\i18n.lib and object debug\i18n.exp
    debug\i18n.exe : fatal error LNK1180: insufficient disk space to complete link
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
    \VC\BIN\link.EXE"' : return code '0x49c'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.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.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.@

    one is using
    @configure -prefix "./qtbase" -static
    nmake@

    and the second is using
    @configure -static
    nmake@

    by the way, the second time, the temporary generated files are really huge,


  • Lifetime Qt Champion

    Hi,

    From the error, your hard drive seems to be almost full, you'll have to make some room to compile Qt


  • Moderators

    well, what do you mean with really huge?

    Obviously, you attempted several times to configure and compile Qt libs. Did you at least always do an "nmake confclean" in between?

    Otherwise you might a mixture of different leftovers, which is not really helpful. Personally, I would suggest to start-over with a complete fresh setup with downloaded .zip file.


  • Moderators

    [quote author="koahnig" date="1375689047"]Personally, I would suggest to start-over with a complete fresh setup with downloaded .zip file. [/quote]

    +1. If you want to make this super-easy for yourself in the future, use git :) Then a simple
    @
    git clean -dxf
    @

    Leaves you with a fresh repo - no need to delete old path and extract the zip again.


Log in to reply
 

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