c++ - 将 QML 应用程序与 Qt5 (5.13.2) 静态链接
问题描述
我在 Linux 上使用以下行编译了 Qt 5.13.2:
/home/Qt/5.13.2/Src/configure -release -static -ltcg -optimize-size -opensource -confirm-license -platform linux-g++ -no-pch -nomake tools -nomake tests -nomake examples -skip webengine -prefix "/home/Qt/513-static"
然后我在 QtCreator 中创建了一个新工具包来使用这个编译。编译后,我试图运行,但我得到了错误
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-egl, wayland.
我的应用程序适用于动态链接。我应该更改 .pro 文件中的某些内容以使其与静态库一起使用吗?
我试图查看官方文档,但有关此信息的信息很差。
解决方案
问题出在编译上。我使用以下行编译并且它有效:
configure -release -static -optimize-size -opensource -confirm-license -feature-freetype -fontconfig -c++std c++2a -no-pch -nomake tools -nomake tests -nomake examples -skip webengine -recheck-all -platform linux-g++ -ltcg -xcb -prefix "/home/vinicius/Qt/Qt-static"
推荐阅读
- java - 如何在java中动态显示一组多个元素?
- deep-learning - LSTM多对多同步序列输入和输出Pytorch损失不减少?
- android - android: retrofit2 post giving error but successful?
- ios - 符合泛型函数中使用的协议和类的类型变量
- angular - 错误离子/角度(嵌套)路由器问题,下一个组件未加载且未显示
- python-3.x - 如何在python中将元组转换为字典
- javascript - 将 vue 函数数据传入 modal
- c# - C# - 多个过滤条件
- kotlin - Kotlin Coroutine Flow apis 是否有 Rx Subject 之类的桥接工具?
- c# - 逆向工程 在 Windows 上收听此设备 - 在没有 API 时对 Windows 进行逆向工程