将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"

最新更新