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. Unable to static compile Qt 2010.05
Forum Updated to NodeBB v4.3 + New Features

Unable to static compile Qt 2010.05

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 5 Posters 5.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.
  • U Offline
    U Offline
    uxbod
    wrote on last edited by
    #1

    Hi,

    For a project we are working on I need to re-compile Qt 2010.05 statically but it fails with the following error:

    @g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    -DGL_SUPPORTED -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -
    DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -
    DQT_NEEDS_QMAIN -I"....\include\QtCore" -I"....\include\QtNetwork" -I"....\in
    clude\QtGui" -I"....\include\QtOpenGL" -I"....\include\QtSql" -I"....\include
    \QtScript" -I"....\include\QtDeclarative" -I"....\include" -I"c:\Build\OpenSSL
    \include" -I"." -I"....\include\QtDeclarative" -I"....\src\declarative\util" -
    I"....\src\declarative\graphicsitems" -I"." -I"....\include\ActiveQt" -I"tmp\m
    oc\release_static" -I"....\mkspecs\win32-g++" -o tmp\obj\release_static\qrc_sta
    rtup.o tmp\rcc\release_static\qrc_startup.cpp
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o ....\bin\qmlviewer.exe object
    _script.qmlviewer.Release -L"c:\Build\qt\qt\lib" -L"c:\Build\qt\qt\lib" -lmingw
    32 -lqtmain -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtOpenG
    L -lglu32 -lopengl32 -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwin
    spool -lmsimg32 -lQtNetwork -lQtCore -lkernel32 -luser32 -lshell32 -luuid -lole3
    2 -ladvapi32 -lws2_32 -Lc:\Build\OpenSSL\lib
    c:\Build\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevalue
    type.cpp:(.text+0x4c8): undefined reference to _imp___Z13qt_defaultDpiv' c:\Build\qt\qt\lib/libQtDeclarative.a(qdeclarativevaluetype.o):qdeclarativevalue type.cpp:(.text+0x552): undefined reference to _imp___Z13qt_defaultDpiv'
    collect2: ld returned 1 exit status
    mingw32-make[3]: *** [....\bin\qmlviewer.exe] Error 1
    mingw32-make[3]: Leaving directory C:/Build/qt/qt/tools/qml' mingw32-make[2]: *** [release] Error 2 mingw32-make[2]: Leaving directory C:/Build/qt/qt/tools/qml'
    mingw32-make[1]: *** [sub-qml-make_default-ordered] Error 2
    mingw32-make[1]: Leaving directory `C:/Build/qt/qt/tools'
    mingw32-make: *** [sub-tools-make_default-ordered] Error 2@

    The configure options I used were:

    C:\Build\qt\qt>configure -release -static -openssl -qt-style-windowsxp -qt-style -windowsvista -I C:\Build\OpenSSL\include -L C:\Build\OpenSSL\lib

    followed by mingw32-make

    Any help would be gratefully appreciated as we need to rebuild a piece of code ASAP and cannot get past this point :(

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stukdev
      wrote on last edited by
      #2

      Have you read "this":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc? Maybe can help you.

      1 Reply Last reply
      0
      • U Offline
        U Offline
        uxbod
        wrote on last edited by
        #3

        I did indeed and that didn't even get as far. With respect to that why would they have a -static configure option if you have to hack away at other files ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stukdev
          wrote on last edited by
          #4

          Is not simple build static lib qt, but most of project use dynamic library because have a lot of benefits.
          You want build static qt for a closed project? Remember static qt can't use in LGPL application.

          1 Reply Last reply
          0
          • ZlatomirZ Offline
            ZlatomirZ Offline
            Zlatomir
            wrote on last edited by
            #5

            When you can't rebuild Qt installed with the SDK, you can download just the Qt sources and static build the sources (and you can have both versions of Qt installed)

            If you want to rebuild the one installed by with SDK, most likely, you will need to do some cleanup, because some older files (make, temporary) might break your build.

            https://forum.qt.io/category/41/romanian

            1 Reply Last reply
            0
            • U Offline
              U Offline
              uxbod
              wrote on last edited by
              #6

              [quote author="Zlatomir" date="1292321980"]When you can't rebuild Qt installed with the SDK, you can download just the Qt sources and static build the sources (and you can have both versions of Qt installed)[/quote]Ah, okay thanks. Will give that a go :)

              1 Reply Last reply
              0
              • U Offline
                U Offline
                uxbod
                wrote on last edited by
                #7

                [quote author="stuk" date="1292320967"]You want build static qt for a closed project? Remember static qt can't use in LGPL application.[/quote]Nope, Qt is being used in an Open Source application under the GNU GPL license so my assumption that it is okay unless you wish to correct my understanding ?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  stukdev
                  wrote on last edited by
                  #8

                  Ok, static for GPL is enable :) Great!
                  [quote author="uxbod" date="1292328452"][quote author="stuk" date="1292320967"]You want build static qt for a closed project? Remember static qt can't use in LGPL application.[/quote]Nope, Qt is being used in an Open Source application under the GNU GPL license so my assumption that it is okay unless you wish to correct my understanding ?

                  [/quote]

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jdupre
                    wrote on last edited by
                    #9

                    Check out this link:

                    http://bugreports.qt.nokia.com/browse/QTBUG-13767

                    Patches were submitted, but they were never applied. (Perhaps the patches break a non-static build?)

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jwhit
                      wrote on last edited by
                      #10

                      I'm new to QT so take that with a grain of salt. Here's how I got the darned thing to appropriately run configure.

                      I'm using QT4.7.0 on WinXP Sp3

                      Create a user variable:

                      QMAKESPEC = "win32-g++"

                      Create mingw_home user variable:

                      MINGW_HOME = "c:\qt\2010.05\mingw" <-- NO BACKSLASH!!!

                      Add the mingw variable to my user path:

                      Path = "...;%MINGW_HOME%\bin;"
                      (For whatever reason the post isn't placing my percent signs in front and behind my MINGW_HOME variable.)
                      Then restart my command prompt and run config -static inside the "c:\qt\2010.05\qt" folder.

                      Ultimately, the ming32-make fails with the message "undefined reference to _imp_Z.... I'm going to try compiling from sources instead. I'll give more feedback later.
                      I hope this helps someone.

                      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