Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. problems creating static Qt (was "5.10.1 broke one of my builds")
QtWS25 Last Chance

problems creating static Qt (was "5.10.1 broke one of my builds")

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
28 Posts 5 Posters 11.5k Views
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by mzimmers
    #1

    UPDATE: I'm renaming this thread, as I've discovered that the problem isn't specific to 5.10.1. I've come up with a workaround, described here.

    ~~

    I built a 5.10.1 for static builds, and I'm now getting lots of unresolved symbols at link. Interestingly enough, my non-static build now breaks in identical fashion. Most of them seem related either to zlib or to qserialport:

    
    C:\qt\static\lib\libQt5Svgd.a(qsvgtinydocument.o): In function `qt_inflateGZipDataFrom':
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtsvg\src\svg/qsvgtinydocument.cpp:106: undefined reference to `z_inflateInit2_'
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtsvg\src\svg/qsvgtinydocument.cpp:133: undefined reference to `z_inflate'
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtsvg\src\svg/qsvgtinydocument.cpp:139: undefined reference to `z_inflateEnd'
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtsvg\src\svg/qsvgtinydocument.cpp:153: undefined reference to `z_inflateReset'
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtsvg\src\svg/qsvgtinydocument.cpp:161: undefined reference to `z_inflateEnd'
    C:\qt\static\plugins\imageformats\libqtiffd.a(tif_zip.o): In function `ZIPCleanup':
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtimageformats\src\plugins\imageformats\tiff/../../../3rdparty/libtiff/libtiff/tif_zip.c:340: undefined reference to `z_deflateEnd'
    C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1\qtimageformats\src\plugins\imageformats\tiff/../../../3rdparty/libtiff/libtiff/tif_zip.c:343: undefined reference to `z_inflateEnd'
    .
    .
    .
    

    Also, why is build still using the qt-everywhere-opensource-src-5.9.1 directory?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you do an out of source build ?
      Is your kit pointing to the right version of Qt ?
      Are you sure there's not a mix between your current static build and the old one ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        Hi Samuel -

        I can't remember what "out of source build" means. I used the script windows-build-qt-static.ps1, though I did have to make a couple minor modifications (worked for 5.9.1).

        Yes, my kit's pointing to my build of 5.10.1 (static).

        I don't know how there'd be a mix between builds, but I suppose anything's possible. Assuming this is the issue, how would I remedy it -- delete and reinstall?

        Thanks....

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's: "not building in the source folder".

          I'd rename the folder to something else, then call make install from your 5.9.1 build folder. Then I'd ensure that the 5.10.1 doesn't use the same prefix as the 5.9.1.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by
            #5

            I just noticed that my /Qt/Static/5.9.1 folder is now empty. Something definitely went awry in the build process.

            Should I unzip the .zip file and start from scratch? First for 5.9.1, then 5.10.1? Anything I should do before this?

            Thanks...

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Not much, ensure that your build folders are not the same as well as use a different prefix and you should be good to go.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • mzimmersM Offline
                mzimmersM Offline
                mzimmers
                wrote on last edited by
                #7

                "different prefix?"

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  The install prefix, basically the folder where make install will put stuff in.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  JKSHJ 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    The install prefix, basically the folder where make install will put stuff in.

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #9

                    @SGaist said in 5.10.1 broke one of my builds:

                    The install prefix, basically the folder where make install will put stuff in.

                    To add to @SGaist's explanation, -prefix is one of the options for configuring your Qt build: http://doc.qt.io/qt-5/configure-options.html

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    2
                    • mzimmersM Offline
                      mzimmersM Offline
                      mzimmers
                      wrote on last edited by mzimmers
                      #10

                      So, I'm back at this. I tried to build a static version of 5.9.4 just to see if that would work, and during configure, I get lots and lot of errors due to a missing OpenGL header file (GLES2/gl2.h). I've never worked with OpenGL directly, so I know very little about it, but in doing a bit of searching, it appears quite tedious to install and configure.

                      I'm assuming that Qt requires OpenGL for something, so merely removing it from the configure command probably isn't an option. Can someone recommend a better course of action?

                      Thanks...

                      EDIT: here's the configure command from the script (with a couple changes from me):

                          cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
                              -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype desktop -no-openssl `
                              -opensource -confirm-license `
                              -make libs -nomake tools -nomake examples -nomake tests"
                      

                      When I removed the -opengl option, I get a message warning me that using OpenGL ES 2.0 on Windows without ANGLE will most likely cause the build to fail.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        What compiler are you using ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • mzimmersM Offline
                          mzimmersM Offline
                          mzimmers
                          wrote on last edited by mzimmers
                          #12

                          Mingw530_32.

                          EDIT: Additional information, from http://doc.qt.io/qt-5/windows-requirements.html#graphics-drivers:

                          Dynamically Loading Graphics Drivers
                          
                          In addition to the build time configuration, Qt supports choosing and loading the OpenGL implementation at runtime. To use this mode, pass -opengl dynamic to the configure script.
                          
                          configure -opengl dynamic
                          
                          Note: As of Qt 5.5 this is the configuration used by the official, pre-built binary packages of Qt. It is strongly recommended to use it also in custom builds, especially for Qt binaries that are deployed alongside applications.
                          

                          If I'm reading this correctly, this wouldn't be a good option for a static build, would it?

                          1 Reply Last reply
                          0
                          • mzimmersM Offline
                            mzimmersM Offline
                            mzimmers
                            wrote on last edited by
                            #13

                            OK, I have another update on this. I think that the whole issue with OpenGL may be due to either a bug in the configure program, or due to me leaving some file behind that I should have deleted between build attempts.

                            I noticed that this command:

                                cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
                                    -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl `
                                    -opensource -confirm-license `
                                    -make libs -nomake tools -nomake examples -nomake tests"
                            

                            (note the presence of the -opengl option)

                            Produced the error I mentioned above, along with an advisement to specify "-opengl desktop." On a hunch, after I ran this configure command, I ran configure again with only the "-opengl desktop" option, then ran make and make install. Both appear to have run successfully.

                            The configure utility is a total black box to me, so I can't even speculate on why this might be happening. My next step is to see if this version of Qt looks good (and shows up) in Creator, then I'll do the same thing for 5.10.1 and compare results.

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Before 5.5 you had to choose whether you would be using the "full desktop OpenGL" backend or ANGLE which sits on top of OpenGL ES2. Since then Qt has a dynamic backend selector which adapts to what is available on the machine your application is run on.

                              You can still do a hard selection if your application requires desktop OpenGL.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1
                              • mzimmersM Offline
                                mzimmersM Offline
                                mzimmers
                                wrote on last edited by
                                #15

                                That makes sense, but it seems that the configure command was ignoring my "-opengl desktop" option when it was part of this command:

                                    cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir `
                                        -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl `
                                        -opensource -confirm-license `
                                        -make libs -nomake tools -nomake examples -nomake tests"
                                

                                It was only when I re-ran configure with only the -opengl option, that it appeared to work. But, I just discovered that doing so failed to re-use my -prefix command, so it installed into /usr/local (on a Windows system). So, I'm running it again, using the "-redo" option.

                                I wonder if the -opengl option is incompatible with one of the other options in that long command line...

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  The options looks correct.

                                  However, what you should do is re-run from a clean state. Changing the OpenGL option is typically something that modifies the build setup.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  2
                                  • mzimmersM Offline
                                    mzimmersM Offline
                                    mzimmers
                                    wrote on last edited by
                                    #17

                                    So, what exactly does it mean to "re-run from a clean slate?" What all do I have to delete or uninstall? The target directory was empty when I did this the first time.

                                    JKSHJ 1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      It means that if you are using an out of source build, then delete folder in which you called configure. Otherwise, you have to cleanup the sources before calling configure again.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      4
                                      • mzimmersM mzimmers

                                        So, what exactly does it mean to "re-run from a clean slate?" What all do I have to delete or uninstall? The target directory was empty when I did this the first time.

                                        JKSHJ Offline
                                        JKSHJ Offline
                                        JKSH
                                        Moderators
                                        wrote on last edited by
                                        #19

                                        @mzimmers said in 5.10.1 broke one of my builds:

                                        So, what exactly does it mean to "re-run from a clean slate?" What all do I have to delete or uninstall?

                                        Delete all the files that were not part of the source code package. These are created the moment configure.bat starts running.

                                        Out-of-source builds, as mentioned by @SGaist, are the easiest to clean: You just delete the entire build folder.

                                        If you didn't use an out-of-source build but you did get the code via git, run this from the same folder as configure.bat to preserve your source files but remove all other files:

                                        > git clean -dfx
                                        > git submodule foreach "git clean -dfx"

                                        The target directory was empty when I did this the first time.

                                        The configuration files are created in your build directory, not your target (PREFIX) directory.

                                        P.S. Using -opengl desktop means that your end-user needs OpenGL drivers provided by their graphics card vendor to run apps built with Qt Quick. The drivers provided by Windows itself are too old.

                                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                        1 Reply Last reply
                                        3
                                        • mzimmersM Offline
                                          mzimmersM Offline
                                          mzimmers
                                          wrote on last edited by
                                          #20

                                          Thanks, JKSH - I need static builds for delivering utility programs to customers. Your last paragraph suggests that opengl desktop probably isn't a good idea for me, then. What is the best approach for producing static builds?

                                          JKSHJ 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