我根据qt istaller中的说明编译了静态qt。 我正在尝试组装qt安装程序。在binarycreator模块上,链接器发出错误:
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__OpenThemeData@8 referenced in function "public: class QColor __thiscall QVistaHelper::basicWindowFrameColor(void)" (?basicWindowFrameColor@QVistaHelper@@QAE?AVQColor@@XZ)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2001: unresolved external symbol __imp__OpenThemeData@8
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__OpenThemeData@8
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__DrawThemeBackground@24 referenced in function "public: virtual void __thiscall QVistaBackButton::paintEvent(class QPaintEvent *)" (?paintEvent@QVistaBackButton@@UAEXPAVQPaintEvent@@@Z)
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__GetThemeColor@20 referenced in function "public: class QColor __thiscall QVistaHelper::basicWindowFrameColor(void)" (?basicWindowFrameColor@QVistaHelper@@QAE?AVQColor@@XZ)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemeColor@20
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemeColor@20
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__GetThemeSysFont@12 referenced in function "struct tagLOGFONTW __cdecl getCaptionLogFont(void *)" (?getCaptionLogFont@@YA?AUtagLOGFONTW@@PAX@Z)
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__IsThemeActive@0 referenced in function "private: static bool __cdecl QVistaHelper::drawBlackRect(class QRect const &,struct HDC__ *)" (?drawBlackRect@QVistaHelper@@CA_NABVQRect@@PAUHDC__@@@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2001: unresolved external symbol __imp__IsThemeActive@0
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__SetWindowThemeAttribute@16 referenced in function "public: void __thiscall QVistaHelper::setTitleBarIconAndCaptionVisible(bool)" (?setTitleBarIconAndCaptionVisible@QVistaHelper@@QAEX_N@Z)
Qt5Widgets.lib(qwizard_win.obj) : error LNK2019: unresolved external symbol __imp__DrawThemeTextEx@36 referenced in function "private: bool __thiscall QVistaHelper::drawTitleText(class QPainter *,class QString const &,class QRect const &,struct HDC__ *)" (?drawTitleText@QVistaHelper@@AAE_NPAVQPainter@@ABVQString@@ABVQRect@@PAUHDC__@@@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__CloseThemeData@4 referenced in function "public: void __thiscall QWindowsXPStylePrivate::cleanupHandleMap(void)" (?cleanupHandleMap@QWindowsXPStylePrivate@@QAEXXZ)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__DrawThemeBackgroundEx@24 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundDirectly(struct HDC__ *,class XPThemeData &,double)" (?drawBackgroundDirectly@QWindowsXPStylePrivate@@QAE_NPAUHDC__@@AAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeBackgroundRegion@24 referenced in function "public: struct HRGN__ * __thiscall XPThemeData::mask(class QWidget *)" (?mask@XPThemeData@@QAEPAUHRGN__@@PAVQWidget@@@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemePartSize@28 referenced in function "public: class QSizeF __thiscall XPThemeData::size(void)" (?size@XPThemeData@@QAE?AVQSizeF@@XZ)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemePartSize@28
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__IsThemeBackgroundPartiallyTransparent@12 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeBool@20 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeInt@20 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemeInt@20
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeEnumValue@20 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemeEnumValue@20
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeMargins@28 referenced in function "public: class QMarginsF __thiscall XPThemeData::margins(class QRect const &,int)" (?margins@XPThemeData@@QAE?AVQMarginsF@@ABVQRect@@H@Z)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemeMargins@28
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemePropertyOrigin@20 referenced in function "public: bool __thiscall QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(class XPThemeData &,double)" (?drawBackgroundThruNativeBuffer@QWindowsXPStylePrivate@@QAE_NAAVXPThemeData@@N@Z)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2001: unresolved external symbol __imp__GetThemePropertyOrigin@20
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__SetWindowTheme@12 referenced in function "private: static bool __cdecl QWindowsXPStylePrivate::initVistaTreeViewTheming(void)" (?initVistaTreeViewTheming@QWindowsXPStylePrivate@@CA_NXZ)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__IsAppThemed@0 referenced in function "public: __thiscall QWindowsXPStylePrivate::QWindowsXPStylePrivate(void)" (??0QWindowsXPStylePrivate@@QAE@XZ)
Qt5Widgets.lib(qwindowsxpstyle.obj) : error LNK2019: unresolved external symbol __imp__GetCurrentThemeName@24 referenced in function "public: virtual void __thiscall QWindowsXPStyle::drawPrimitive(enum QStyle::PrimitiveElement,class QStyleOption const *,class QPainter *,class QWidget const *)const " (?drawPrimitive@QWindowsXPStyle@@UBEXW4PrimitiveElement@QStyle@@PBVQStyleOption@@PAVQPainter@@PBVQWidget@@@Z)
Qt5Widgets.lib(qwindowsvistastyle.obj) : error LNK2019: unresolved external symbol __imp__GetThemeTransitionDuration@24 referenced in function "public: virtual void __thiscall QWindowsVistaStyle::drawControl(enum QStyle::ControlElement,class QStyleOption const *,class QPainter *,class QWidget const *)const " (?drawControl@QWindowsVistaStyle@@UBEXW4ControlElement@QStyle@@PBVQStyleOption@@PAVQPainter@@PBVQWidget@@@Z)
编译标志qt:
configure -prefix "C:\Qt\static" -release -static -static-runtime -opensource -confirm-license -accessibility -no-opengl -no-icu -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -skip qtactiveqt -skip qtenginio -skip qtlocation -skip qtmultimedia -skip qtserialport -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtwebkit -skip qtwebsockets -skip qtxmlpatterns -skip qt3d
win32-msvc2013的Qt版本5.8.0(qt-everywhere-opensource-src-5.8.0.zip)。
答案 0 :(得分:2)
看起来链接器找不到<OutputType>Exe</OutputType>
或构建配置中缺少{。<}>。
尝试添加UxTheme.lib
。
答案 1 :(得分:0)
在我的情况下,版本5.5.1有帮助。 solution中的详细信息 编译:
configure -prefix "C:\Qt\static" -platform win32-msvc2013 -static -release -opensource -confirm-license -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -skip qtactiveqt -skip qtenginio -skip qtlocation -skip qtserialport -skip qtquick1 -skip qtsensors -skip qtwebkit -skip qtwebsockets -skip qtxmlpatterns -skip qt3d -opengl desktop -no-angle -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -no-openssl -make libs -make tools