Qt creator 如何设置静态编译

背景

安装Qt时默认的是使用动态库,因此并没有提供编译好的静态库下载。因此,我们需要下载/安装相应的Qt源码,自己动手生成静态库。
不然没法直接一个exe运行,还需要拷贝动态库、配置环境变量等。

编译Qt

Qt5.8 在windows下静态编译
https://blog.csdn.net/zhaoxd200808501/article/details/79368841

http://c.biancheng.net/view/3858.html

1.配置Qt(1分钟)

切换到Qt的源码目录

cd C:\Qt\Qt5.9.9\5.9\Src

运行命令

configure.bat -confirm-license -opensource -platform win32-g++ -release -static -static-runtime -opengl desktop -qt-sqlite -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -nomake tests -nomake examples -no-compile-examples -prefix "E:\Qt\Qt5.9.9\5.9.9\mingw53_32_static"

2.编译(4小时左右)

mingw32-make -j2

3.安装(20分钟左右,硬盘好的话会快点)

mingw32-make install

参加资料

Qt5.8 在windows下静态编译
https://blog.csdn.net/zhaoxd200808501/article/details/79368841

怎样静态编译Qt程序
https://jingyan.baidu.com/article/363872ec3db7386e4aa16f53.html

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值