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. Static Build Fails on Windows 7 Professional X64 with QTSDK

Static Build Fails on Windows 7 Professional X64 with QTSDK

Scheduled Pinned Locked Moved Installation and Deployment
19 Posts 5 Posters 16.4k 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.
  • D Offline
    D Offline
    DarkSnake-Kobra
    wrote on last edited by
    #1

    Hi everyone glad to be here. :) I'm having an issue with the QTSDK. I've never had a problem with the QT Creator 2.1 and QT Libraries for MinGW, but when I run the QT 4.7.3 for Desktop(MinGW) command line tool I get a mess of errors when trying to build the static library with configure -static through the QTSources4.7.3 directory. Here's the result error(post limit prevented me from posting all of it so let me know if you need it)

    @mingw32-make: *** [project.o] Error 1
    Building qmake failed, return code 2@

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      You can use "pastebin.com":http://www.pastebin.com to post larger amounts of text data.
      You might include your configure.cache and .qmake.cache files as well.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        as this is only a small part of the error message, it says nothing.
        Which library, which files were already processed.
        Which configure parameters did you use?
        What did you do to compile Qt statically. Did you follow "this guide":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc ?

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • U Offline
          U Offline
          ucomesdag
          wrote on last edited by
          #4

          Building from QtSources requires Perl to be installed download and install "ActivePerl":http://www.activestate.com/activeperl/downloads it generally hangs when building qmake when Perl is missing.

          Write “Qt”, not “QT” (QuickTime).

          1 Reply Last reply
          0
          • U Offline
            U Offline
            ucomesdag
            wrote on last edited by
            #5

            If you don't want to install Perl, then download and use the source zip from "here":http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip.

            Note: When running configure on QtSources it wants to run syncqt which requires Perl to work.

            Write “Qt”, not “QT” (QuickTime).

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DarkSnake-Kobra
              wrote on last edited by
              #6

              I installed ActivePerl which seemed to get me past the previous point it failed, but still not working. Guess I was using the older guide via a google search. Still quite confused on [url=http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc]this[/url] one

              "First download the QtSDK you need, I took 4.7.0 and install it (incl. gcc).
              Then copy the complete qt file tree from Path-To-Qt-SDK\qt to Path-To-Qt-SDK\qt-static (or whatever path you prefer).
              copy Path-To-Qt-SDK\bin\qtenv.bat to static folder and adapt content —> replace xxx\qt with XXX\qt_static"

              What do they mean by "complete qt file tree"? The 4.7.3 etc under the QTSources folder or the entire QTSDK folder?

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

                I in your case you should do:

                Copy C:\QtSDK\QtSources\4.7.3 to C:\QtSDK\Desktop\Qt\4.7.3-static

                Edit the C:\QtSDK\Desktop\Qt\4.7.3-static\mkspecs\win32-g++\qmake.conf as mentioned add the bold marked items:
                QMAKE_CFLAGS_RELEASE = -Os -momit-leaf-frame-pointer
                QMAKE_LFLAGS = -static -static-libgcc …
                DEFINES += QT_STATIC_BUILD

                Edit C:\QtSDK\Desktop\Qt\4.7.3-static\qmake\Makefile.win32-g++
                LFLAGS = -static -static-libgcc …

                Edit C:\QtSDK\Desktop\Qt\4.7.3-static\src\3rdparty\webkit\WebKit.pri
                add CONFIG += staticlib at the top

                At the dos prompt CD to C:\QtSDK\Desktop\Qt\4.7.3-static
                Run: @> set PATH=C:\QtSDK\mingw\bin;%PATH%

                configure.exe -static -debug-and-release -opensource -confirm-license -platform win32-g++ -no-exceptions -dont-process -no-qt3support -webkit -qt-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg@

                Then accordin to the wiki run:
                @> bin\qmake.exe projects.pro QT_BUILD_PARTS=“libs” JAVASCRIPTCORE_JIT=“yes”@

                And at last you run mingw32-make.exe
                @> C:\QtSDK\mingw\bin\mingw32-make.exe sub-src@

                Write “Qt”, not “QT” (QuickTime).

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  ucomesdag
                  wrote on last edited by
                  #8

                  It has been a while since the last time I had Qt build statically, so I don't know if the wiki article is correct on all the settings... so don't blame me if it doesn't build correctly ;-)

                  Apart for the makespecs and make file editing and the configure options, the sameway I build Qt with openssl support from QtSources.

                  Write “Qt”, not “QT” (QuickTime).

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DarkSnake-Kobra
                    wrote on last edited by
                    #9

                    I got everything done up until the dos prompt. Everything except creating qmake went fine.

                    @Creating qmake...
                    execute: File or path is not found (mingw32-make)
                    execute: File or path is not found (mingw32-make)
                    Cleaning qmake failed, return code -1@

                    1 Reply Last reply
                    0
                    • U Offline
                      U Offline
                      ucomesdag
                      wrote on last edited by
                      #10

                      Do @> set PATH=C:\QtSDK\mingw\bin;%PATH%@ and rerun configure with your arguments. Sorry my mistake, forgot to mention that part ;-). I edited my post accordingly.

                      Write “Qt”, not “QT” (QuickTime).

                      1 Reply Last reply
                      0
                      • U Offline
                        U Offline
                        ucomesdag
                        wrote on last edited by
                        #11

                        Maybe you could update the wiki, if you succeed, with your findings?

                        Write “Qt”, not “QT” (QuickTime).

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DarkSnake-Kobra
                          wrote on last edited by
                          #12

                          Still not working. Unless I'm not setting the environmental variable for MinGW correctly?

                          @Variable Name %PATH%
                          Variable Value C:\QtSDK\mingw\bin@

                          1 Reply Last reply
                          0
                          • U Offline
                            U Offline
                            ucomesdag
                            wrote on last edited by
                            #13

                            If you posted the whole message you got and not just a part, it would be much easier to help you out.

                            Did you set, like I showed you, the path to mingw32-make at the prompt before rerunning configure?

                            Write “Qt”, not “QT” (QuickTime).

                            1 Reply Last reply
                            0
                            • D Offline
                              D Offline
                              DarkSnake-Kobra
                              wrote on last edited by
                              #14

                              The command prompt was cutting it off. Have it in a text file so I'll post it if I have an issue again.

                              Ah I misunderstood that. Seems like it's actually building now, but I don't know for sure so I'll post an update after a bit.:)

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                DarkSnake-Kobra
                                wrote on last edited by
                                #15

                                It failed again saying interrupt. Is there a way that when I'm about ready to release a program I can compile it against the libraries without having static set up? Nokia needs to provide better documentation on this.

                                1 Reply Last reply
                                0
                                • U Offline
                                  U Offline
                                  ucomesdag
                                  wrote on last edited by
                                  #16

                                  Until now you only given incomplete error messages. As said before if you provide us with the full error message maybe someone will be able to help you.

                                  Write “Qt”, not “QT” (QuickTime).

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    lgeyer
                                    wrote on last edited by
                                    #17

                                    [quote author="DarkSnake-Kobra" date="1309984350"]Is there a way that when I'm about ready to release a program I can compile it against the libraries without having static set up?[/quote]

                                    Build your application as usual and redistribute the Qt libraries (.dlls) along with your application. (There are tons of threads on how to do this.)

                                    If you really consider to link Qt statically to your application you should probably "consider":http://developer.qt.nokia.com/forums/viewthread/6749/ buying a commercial license too.

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      DarkSnake-Kobra
                                      wrote on last edited by
                                      #18

                                      Was just thinking on that. I think it'll be easier to compress the libraries with UPX and redistribute them with the programs.:)

                                      Everything resolved now.:)

                                      1 Reply Last reply
                                      0
                                      • H Offline
                                        H Offline
                                        heba
                                        wrote on last edited by
                                        #19

                                        please, how can I redistribute Qt dlls ?

                                        I use Qt 5.2, I need to create Stand-Alone .exe file as a Release from my application, and till now static Qt build fails.
                                        Even it completes, Qml and Quick doesn't known for Qt.

                                        So, If there are any other solution to get stand-alone file, that will be very appreciated.

                                        Thank you,

                                        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