0

Trying to make a program cross-platform, QT is required to be linked statically. I am struggling with dependencies.

After several hours researching, I managed to get the dependencies missing down to the following errors, for which I could not find much information around.

As an additional information, I could not include Qt5PlatformSupport, which does not seems to exists in Qt 5.12.2

qwindowsd.lib(qwindowsuiaaccessibility.obj):-1: error: LNK2019: unresolved external symbol "public: static class QWindowsUiaWrapper * __cdecl QWindowsUiaWrapper::instance(void)" (?instance@QWindowsUiaWrapper@@SAPAV1@XZ) referenced in function "public: static bool __cdecl QWindowsUiaAccessibility::handleWmGetObject(struct HWND__ *,unsigned int,long,long *)" (?handleWmGetObject@QWindowsUiaAccessibility@@SA_NPAUHWND__@@IJPAJ@Z)
qwindowsd.lib(qwindowsuiaaccessibility.obj):-1: error: LNK2019: unresolved external symbol "public: int __thiscall QWindowsUiaWrapper::ready(void)" (?ready@QWindowsUiaWrapper@@QAEHXZ) referenced in function "public: virtual void __thiscall QWindowsUiaAccessibility::notifyAccessibilityUpdate(class QAccessibleEvent *)" (?notifyAccessibilityUpdate@QWindowsUiaAccessibility@@UAEXPAVQAccessibleEvent@@@Z)
qwindowsd.lib(qwindowsuiaaccessibility.obj):-1: error: LNK2019: unresolved external symbol "public: int __thiscall QWindowsUiaWrapper::clientsAreListening(void)" (?clientsAreListening@QWindowsUiaWrapper@@QAEHXZ) referenced in function "public: virtual void __thiscall QWindowsUiaAccessibility::notifyAccessibilityUpdate(class QAccessibleEvent *)" (?notifyAccessibilityUpdate@QWindowsUiaAccessibility@@UAEXPAVQAccessibleEvent@@@Z)
qwindowsd.lib(qwindowsuiaaccessibility.obj):-1: error: LNK2019: unresolved external symbol "public: long __thiscall QWindowsUiaWrapper::returnRawElementProvider(struct HWND__ *,unsigned int,long,struct IRawElementProviderSimple *)" (?returnRawElementProvider@QWindowsUiaWrapper@@QAEJPAUHWND__@@IJPAUIRawElementProviderSimple@@@Z) referenced in function "public: static bool __cdecl QWindowsUiaAccessibility::handleWmGetObject(struct HWND__ *,unsigned int,long,long *)" (?handleWmGetObject@QWindowsUiaAccessibility@@SA_NPAUHWND__@@IJPAJ@Z)
qwindowsd.lib(qwindowsuiamainprovider.obj):-1: error: LNK2019: unresolved external symbol "public: long __thiscall QWindowsUiaWrapper::hostProviderFromHwnd(struct HWND__ *,struct IRawElementProviderSimple * *)" (?hostProviderFromHwnd@QWindowsUiaWrapper@@QAEJPAUHWND__@@PAPAUIRawElementProviderSimple@@@Z) referenced in function "public: virtual long __stdcall QWindowsUiaMainProvider::get_HostRawElementProvider(struct IRawElementProviderSimple * *)" (?get_HostRawElementProvider@QWindowsUiaMainProvider@@UAGJPAPAUIRawElementProviderSimple@@@Z)
qwindowsd.lib(qwindowsuiamainprovider.obj):-1: error: LNK2019: unresolved external symbol "public: long __thiscall QWindowsUiaWrapper::raiseAutomationPropertyChangedEvent(struct IRawElementProviderSimple *,int,struct tagVARIANT,struct tagVARIANT)" (?raiseAutomationPropertyChangedEvent@QWindowsUiaWrapper@@QAEJPAUIRawElementProviderSimple@@HUtagVARIANT@@1@Z) referenced in function "public: static void __cdecl QWindowsUiaMainProvider::notifyStateChange(class QAccessibleStateChangeEvent *)" (?notifyStateChange@QWindowsUiaMainProvider@@SAXPAVQAccessibleStateChangeEvent@@@Z)
qwindowsd.lib(qwindowsuiamainprovider.obj):-1: error: LNK2019: unresolved external symbol "public: long __thiscall QWindowsUiaWrapper::raiseAutomationEvent(struct IRawElementProviderSimple *,int)" (?raiseAutomationEvent@QWindowsUiaWrapper@@QAEJPAUIRawElementProviderSimple@@H@Z) referenced in function "public: static void __cdecl QWindowsUiaMainProvider::notifyFocusChange(class QAccessibleEvent *)" (?notifyFocusChange@QWindowsUiaMainProvider@@SAXPAVQAccessibleEvent@@@Z)

What library is required to fulfill those symbols?

Helpful questions related to this, which did not help:

Adrian Maire
  • 14,354
  • 9
  • 45
  • 85

2 Answers2

2

I use a smaller list of libraries, you may refer to it:

Qt5Core.lib
Qt5Gui.lib
Qt5Widgets.lib
Qt5ThemeSupport.lib
Qt5WindowsUiAutomationSupport.lib
Qt5EventDispatcherSupport.lib
Qt5FontDatabaseSupport.lib
qtmain.lib
qwindows.lib
qtpcre2.lib
qtlibpng.lib
qtharfbuzz.lib
Ws2_32.lib
Imm32.lib
WinMM.lib
Version.lib
Netapi32.lib
Userenv.lib
Dwmapi.lib
Destiny
  • 466
  • 5
  • 8
1

Simple and stupid: I was missing the Qt5WindowsUIAutomationSupport library.
I keep it as answer if anybody face the same issue.

In general, I had to include following libraries:

Qt5AccessibilitySupport
Qt5WindowsUiAutomationSupport
Qt5ThemeSupport
Qt5FontDatabaseSupport
qtpre2
qtharfbuzz
qtlibpng
qtfreetype
Qt5EventDispatcherSupport

Dwmapi
imm32
netapi32
wtsapi32
winmm
zlib
bcrypt
version
userenv

And additionally, it is required to startup the platform plugins before the QApplication creation:

#include <QtPlugin>

Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
Adrian Maire
  • 14,354
  • 9
  • 45
  • 85