如何解决将 QWindowsIntegrationPlugin 与 Qt6 静态库一起使用时出现未定义符号错误?
开发过程中遇到将 QWindowsIntegrationPlugin 与 Qt6 静态库一起使用时出现未定义符号错误的问题如何解决?下面主要结合日常开发的经验,给出你关于将 QWindowsIntegrationPlugin 与 Qt6 静态库一起使用时出现未定义符号错误的解决方法建议,希望对你解决将 QWindowsIntegrationPlugin 与 Qt6 静态库一起使用时出现未定义符号错误有所启发或帮助;问题描述
我已经为 windows 构建了 Qt6 的静态库。
源代码是从 Qt 的 git repo 和下面使用的配置命令克隆的,后跟 cmake --build
和 cmake --install
:
..\qt5\configure -deBUG-and-release -prefix <path_to_libs> -commercial -confirm-license -make libs -nomake tools -nomake examples -nomake tests -static
在代码中,当使用 Q_import_PLUGIN (QwindowsIntegrationPlugin);
时,我收到以下链接器错误。我不确定构建的库是否不完整,或者我需要添加一些当前缺少的依赖项。
lld-link : error : undefined symbol: int __cdecl qInitResources_openglblackLists(voID)
>>> referenced by qwindows.lib(qwindowsintegration.cpp.obj):($LN179)
lld-link : error : undefined symbol: int __cdecl qInitResources_cursors(voID)
>>> referenced by qwindows.lib(qwindowscursor.cpp.obj):($LN26)
lld-link : error : undefined symbol: int __cdecl qInitResources_scenegraph(voID)
>>> referenced by Qt6Quick.lib(qsgdefaultcontext.cpp.obj):(voID __cdecl `dynamic initializer for '`anonymous namespace'::initResources_ctor_instance_''(voID))
ninja: build stopped: subcommand Failed.
我正在使用 Qt6 的这些静态库,使用的 IDE 是 Visual Studio。
尚未找到解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)