Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems with building
Qt 6.11 is out! See what's new in the release blog

Problems with building

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 5 Posters 1.7k 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.
  • S Offline
    S Offline
    Sucharek
    wrote on last edited by Sucharek
    #1

    Hi, I recently compiled Qt 6.5.2 Static from source on Windows. But when I try to use it, I get strange errors.

    While trying to compile it, I ran into a few issues. Firstly, (strawberry) perl wasn't working, so I used MinGW (mingw1120_64) included in the Tools folder that the maintenance tool made and that worked. I got a warning that without perl some stuff doesn't have to work properly. Secondly, I got an error that QtWebEngine won't be built, but I don't remember what was the error (QtPdf also didn't build, because I don't have nodejs 12.0 installed, but I don't care about that). The build process also stopped once, because I ran out of storage space.

    Anyway, here are the errors that I'm currently facing:

    error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x6a): undefined reference to `__imp_VariantInit'
    
    error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x13d): undefined reference to `__imp_VariantClear'
    
    error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x1ea): undefined reference to `__imp_VariantClear'
    
    error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x261): undefined reference to `__imp_VariantClear'
    

    Edit:
    I forgot to mention, this is the modules included in my .pro file: core gui websockets network

    And the included files in my header file (not everything):

    #include <QtWebSockets/QWebSocket>
    #include <QJsonObject>
    #include <QJsonDocument>
    #include <QDebug>
    #include <QHostInfo>
    #include <QNetworkInterface>
    
    T 1 Reply Last reply
    0
    • S Sucharek

      Hi, I recently compiled Qt 6.5.2 Static from source on Windows. But when I try to use it, I get strange errors.

      While trying to compile it, I ran into a few issues. Firstly, (strawberry) perl wasn't working, so I used MinGW (mingw1120_64) included in the Tools folder that the maintenance tool made and that worked. I got a warning that without perl some stuff doesn't have to work properly. Secondly, I got an error that QtWebEngine won't be built, but I don't remember what was the error (QtPdf also didn't build, because I don't have nodejs 12.0 installed, but I don't care about that). The build process also stopped once, because I ran out of storage space.

      Anyway, here are the errors that I'm currently facing:

      error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x6a): undefined reference to `__imp_VariantInit'
      
      error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x13d): undefined reference to `__imp_VariantClear'
      
      error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x1ea): undefined reference to `__imp_VariantClear'
      
      error: C:\Qt\6.5.2-static\plugins\networkinformation\libqnetworklistmanager.a(qnetworklistmanagerevents.cpp.obj):qnetworklistmanagerevents.cpp:(.text$_ZN25QNetworkListManagerEvents24checkBehindCaptivePortalEv+0x261): undefined reference to `__imp_VariantClear'
      

      Edit:
      I forgot to mention, this is the modules included in my .pro file: core gui websockets network

      And the included files in my header file (not everything):

      #include <QtWebSockets/QWebSocket>
      #include <QJsonObject>
      #include <QJsonDocument>
      #include <QDebug>
      #include <QHostInfo>
      #include <QNetworkInterface>
      
      T Offline
      T Offline
      The Smiling Mickey
      wrote on last edited by The Smiling Mickey
      #2

      @Sucharek I am trying to build a static file as well. I built static Qt 6.6 from source on Windows and I'm getting the exact same errors. The modules included in my program are quick and opengl. I don't understand why any network stuff is even being linked in my case. It would be cool if anyone could point out what we are possibly missing.

      Christian EhrlicherC A 2 Replies Last reply
      0
      • T The Smiling Mickey

        @Sucharek I am trying to build a static file as well. I built static Qt 6.6 from source on Windows and I'm getting the exact same errors. The modules included in my program are quick and opengl. I don't understand why any network stuff is even being linked in my case. It would be cool if anyone could point out what we are possibly missing.

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        The missing functions come from windows: https://learn.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-variantinit so you should link against oleauth lib as described in the msdn documentation.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        T 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          The missing functions come from windows: https://learn.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-variantinit so you should link against oleauth lib as described in the msdn documentation.

          T Offline
          T Offline
          The Smiling Mickey
          wrote on last edited by
          #4

          @Christian-Ehrlicher Turns out one of the qt files already adds the linkage -loleaut32. Adding it to the pro file does nothing. Still get the same error message. Tested the function Variantinit in debug mode with dynamic linkage so OleAut32.lib seems to be working.

          Christian EhrlicherC 1 Reply Last reply
          0
          • T The Smiling Mickey

            @Christian-Ehrlicher Turns out one of the qt files already adds the linkage -loleaut32. Adding it to the pro file does nothing. Still get the same error message. Tested the function Variantinit in debug mode with dynamic linkage so OleAut32.lib seems to be working.

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            When linking static the order of the libs is important. Imo it must be before libqnetworklistmanager.a
            Or even simpler - use dynamic linking.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            T J 2 Replies Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              When linking static the order of the libs is important. Imo it must be before libqnetworklistmanager.a
              Or even simpler - use dynamic linking.

              T Offline
              T Offline
              The Smiling Mickey
              wrote on last edited by
              #6

              @Christian-Ehrlicher Yeah, according to the compile output oleaut32 comes before qnetworklistmanager.

              1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                When linking static the order of the libs is important. Imo it must be before libqnetworklistmanager.a
                Or even simpler - use dynamic linking.

                J Offline
                J Offline
                jchaviano
                wrote on last edited by
                #7

                @Christian-Ehrlicher
                how i change the order in static

                1 Reply Last reply
                0
                • T The Smiling Mickey

                  @Sucharek I am trying to build a static file as well. I built static Qt 6.6 from source on Windows and I'm getting the exact same errors. The modules included in my program are quick and opengl. I don't understand why any network stuff is even being linked in my case. It would be cool if anyone could point out what we are possibly missing.

                  A Offline
                  A Offline
                  asacloud
                  wrote on last edited by
                  #8

                  @The-Smiling-Mickey I also had the same problem with static Qt 6.7. I found the -loleaut32 needs to be after the libqnetworklistmanager.a.

                  My 'quick-fix' solution is to add -loleaut32 to the list of lib dependencies (QMAKE_PRL_LIBS) in <qt6.x-static dir>/plugins/networkinformation/qnetworklistmanager.prl

                  The root of the problem seems to lie in Src/qtbase/src/plugins/networkinformation/networklistmanager/CMakeLists.txt, which adds the additional Windows dependencies for MSVC but not MINGW. Fiddling with that I managed recompile the Qt 6.7 Static build so that the right dependency ends up in qnetworklistmanager.prl. But I don't know my way around the CMakeLists, so I won't bother listing that change here; and the quick fix above is simpler anyway.

                  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