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. Qt (Static Build) Unresolved Externals (MSVC2017)

Qt (Static Build) Unresolved Externals (MSVC2017)

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 3.8k 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.
  • J Offline
    J Offline
    jmarkson
    wrote on last edited by
    #1

    After a day or so I've finally gotten a (or what should be) statically compiled Qt Library. I have downloaded the single zip file src that is on the /download page. ave ran configure.bat and jom, yet when I try to make a stand-alone application I run into 171 Unresolved externals from the following libraries

    Qt5Gui.lib
    Qt5Core.lib
    Qt5Widgets.lib
    qwindows.lib
    

    I have googled for around 40 minutes to an hour now with no solution found. I found many posts with similar issues on SO and Qt Forum which say "Oh I included this and that and it works!", but I have included/linked all I have found (and much more) in hoped for a fix with nothing working.

    TL;DR Libs listed above are giving out unresolved externals and I've no idea why.
    All linked libraries:

    /kernel32.lib
    user32.lib
    shell32.lib
    uuid.lib
    ole32.lib
    advapi32.lib
    ws2_32.lib
    gdi32.lib
    comdlg32.lib
    oleaut32.lib
    imm32.lib
    winmm.lib
    qtmain.lib
    opengl32.lib
    qwindows.lib
    Qt5PlatformCompositorSupport.lib
    d3d9.lib
    qtfreetype.lib
    Qt5Core.lib
    Qt5Gui.lib
    Qt5Widgets.lib
    

    All includes (across all files)

    #include <QtGui\qwindow.h>
    #include <QtWidgets/QMainWindow>
    #include "ui_statictest.h"
    #include "statictest.h"
    #include <QtPlugin>
    #include <QtWidgets/QApplication>
    

    Compiling with MSVC 2017 for Release build x86

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      I'm not an expert in this area. But just as a heads-up before others try to help you: it might help if you gave a few examples (from your 171) of precisely what symbols are reported unresolved, so that someone could perhaps identify a missing library.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jmarkson
        wrote on last edited by
        #3

        Good point.
        First error for each different lib:

        Severity	Code	Description	Project	File	Line	Suppression State Error	LNK2019	unresolved external symbol _GetFileVersionInfoSizeW@8 referenced in function "public: class QString __thiscall QCoreApplicationPrivate::appVersion(void)const " (?appVersion@QCoreApplicationPrivate@@QBE?AVQString@@XZ)	statictest	C:\Users\Justin\Documents\Visual Studio 2017\Projects\statictest\statictest\Qt5Core.lib(qcoreapplication_win.obj)	1	
        
        Severity	Code	Description	Project	File	Line	Suppression State
        Error	LNK2019	unresolved external symbol _GetFileVersionInfoSizeW@8 referenced in function "public: class QString __thiscall QCoreApplicationPrivate::appVersion(void)const " (?appVersion@QCoreApplicationPrivate@@QBE?AVQString@@XZ)	statictest	C:\Users\Justin\Documents\Visual Studio 2017\Projects\statictest\statictest\Qt5Core.lib(qcoreapplication_win.obj)	1	
        
        
        Severity	Code	Description	Project	File	Line	Suppression State
        Error	LNK2019	unresolved external symbol __imp__GetThemeColor@20 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)	statictest	C:\Users\Justin\Documents\Visual Studio 2017\Projects\statictest\statictest\Qt5Widgets.lib(qwindowsxpstyle.obj)	1	
        
        
        Severity	Code	Description	Project	File	Line	Suppression State
        Error	LNK2019	unresolved external symbol "class QStringList __cdecl QAccessibleBridgeUtils::effectiveActionNames(class QAccessibleInterface *)" (?effectiveActionNames@QAccessibleBridgeUtils@@YA?AVQStringList@@PAVQAccessibleInterface@@@Z) referenced in function "public: virtual long __stdcall QWindowsIA2Accessible::doAction(long)" (?doAction@QWindowsIA2Accessible@@UAGJJ@Z)	statictest	C:\Users\Justin\Documents\Visual Studio 2017\Projects\statictest\statictest\qwindows.lib(iaccessible2.obj)	1	
        
        
        

        All errors:
        https://hastebin.com/ilahojenut.tex

        1 Reply Last reply
        0
        • JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          So, for example, just taking the unresolved __imp__GetThemePartSize@28, I see in your output, https://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(GetThemePartSize);k(DevLang-C);k(TargetOS-WINDOWS)&rd=true states you will need static library UxTheme.lib, which I don't see among your libraries?

          Also I note that says that is for "desktop apps only", since you're linking statically I don't know if there is a compiler/linker option you might need to pass to indicate that....

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jmarkson
            wrote on last edited by jmarkson
            #5

            I'll take a look at the UxTheme lib now. As for the compiler/linker option tos I've already done that.
            //edit
            You were right! Including that lib has taken the 171 unresolved externals to 154
            Going further down the list of errors and including libs of the functions on MSDN is now only decreasing by 0-2 errors per lib.

            1 Reply Last reply
            0
            • JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              An unresolved was _pcre2_config_16.

              So I'm doing your Googling for you ;-)
              https://doc.qt.io/qt-5/qtcore-attribution-pcre2.html
              http://www.regular-expressions.info/pcre2.html
              Search for maybe pcre2 windows binary

              Does that _16 indicates it's 16-bit....?? Good luck :)

              _hb_buffer stuff? See https://stackoverflow.com/questions/41765673/static-linking-against-qt-on-windows-using-cmake

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jmarkson
                wrote on last edited by
                #7

                pcre2 was not in the path Qt docs said it was (Might be the issue) as for the HB errors does this mean they're unfixable? Checking the SO you linked the bug report is still unresolved.

                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