[英]How to use my static Qt build with Creator?
在构建Qt 5.6 msvc进行静态部署之后,我做了大约4个小时就成功构建了Qt(配置-static -platform win32-msvc2013 -nomake示例-nomake测试),然后我打开了一个新项目,但是在.pro CONFIG + =静态并切换到发布模式,并得到缺少库的错误,它的正常窗口小部件,当从发布文件夹运行exe时,其大小很小,约为20 kb,是否缺少步骤?
Don't add CONFIG += static
to the project, it is not necessary. 不要将CONFIG += static
添加到项目中,这是没有必要的。 The same PRO file can work with either a dynamic or static Qt build, which is convenient, since you can use the faster to compile and capable of debugging dynamic build for development, and only use the static build for final production. 相同的PRO文件可以与动态或静态Qt构建一起使用,这很方便,因为您可以使用更快的速度进行编译并可以调试动态构建以进行开发,而只能将静态构建用于最终生产。
After your static build is completed, you need to add it to a kit, and add the kit to your project: 完成静态构建后,您需要将其添加到工具箱中,并将该工具箱添加到您的项目中:
bin\\qmake.exe
从“ Qt版本”中单击“添加...”,然后选择构建的bin\\qmake.exe
That's about it... if your build is OK your app should build and run. 就是这样...如果您的构建正常,则应构建并运行应用。
Keep in mind that if you distribute closed source applications build statically you need to provide your object files and information about the used tools and versions to satisfy the requirement of LGPL about providing an option to re-link your application against a different version of the library. 请记住,如果您以静态方式分发封闭源应用程序,则需要提供目标文件以及有关所用工具和版本的信息,以满足LGPL有关提供选项以将应用程序与其他版本的库重新链接的要求。 。 That's assuming you don't own a commercial Qt license. 假设您没有商业Qt许可证。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.