Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt - static build
Forum Updated to NodeBB v4.3 + New Features

Qt - static build

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 4 Posters 6.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    portfolis
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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).

      (Z(:^

      1 Reply Last reply
      0
      • V Offline
        V Offline
        viewbios
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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.

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            allopen
            wrote on last edited by
            #5

            see http://stackoverflow.com/questions/14932315/how-to-compile-qt-5-under-windows-or-linux-32-or-64-bit-static-or-dynamic-on-v, it works!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              allopen
              wrote on last edited by
              #6

              see http://stackoverflow.com/questions/14932315/how-to-compile-qt-5-under-windows-or-linux-32-or-64-bit-static-or-dynamic-on-v, it works!

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved