linux(deepin)下编译Qt|linux(deepin)下编译Qt 5.12.0静态库
1. 下载 先下载自己QT版本对应的源码,这里我使用最新的5.12.0版本
进入链接:https://download.qt.io/archive/qt/5.12/5.12.0/single/2. 解压
下载qt-everywhere-src-5.12.0.tar.xz
sudo tar -xvf qt-everywhere-src-5.12.0.tar.xz3. 编译 在这里我只编译了qt的一些基本功能,具体请参考:《 linux下编译qt5.6.0静态库——configure配置》
1) 首先configure生成makefile:
./configure -static -release -nomake examples -qt-sqlite -qt-zlib -qt-libpng -qt-libjpeg -openssl-linked -no-qml-debug -opengl -qt-freetype -no-angle -nomake tests -qt-xcb -skip qtquickcontrols -skip qtquickcontrols2 -skip qtsensors -skip qtdoc -prefix /usr/local/Qt5.12.0_staticwaring:应该含有 -fontconfig ,但编译始终通不过,只得尝试-qt-freetype
重要参数说明:
-static : 静态编译
-release : 只编译release版本的库
-prefix :后面跟着静态编译后的qt的存放位置
--fontconfig : 事实证明没这个gui会不能显示中文字体
期间可以看到qt各种组件的安装情况,可以根据需求再次生成想要的makefile。
接下来看到这样的提示代表configure成功。
文章图片
configure成功结束 2)开始编译 使用以下命令进行编译,编译的时间是漫长的,这时候可以去做点其他事。
make -j4说明:make -jn中 n指编译的线程数,n越大编译速度越快,笔者的电脑是4线程便使用4.
sudo make install4. 配置Qt环境
打开 QT Creator ->选项,选中默认套件,点击克隆
文章图片
克隆 第二步,选中克隆套件,点击manage:
文章图片
manage 第三步,将编译好的qmake执行文件添加进去。
如果之前的步骤按照我的来,目录是:/usr/local/Qt5.12.0_static/bin/qmake【linux(deepin)下编译Qt|linux(deepin)下编译Qt 5.12.0静态库】
文章图片
推荐阅读
- 开学第一天(下)
- 【故障公告】周五下午的一次突发故障
- 生活随笔|好天气下的意外之喜
- MongoDB,Wondows下免安装版|MongoDB,Wondows下免安装版 (简化版操作)
- 汇讲-勇于突破
- Android中的AES加密-下
- 说的真好
- 放下心中的偶像包袱吧
- Linux下面如何查看tomcat已经使用多少线程
- 【1057快报】深入机关,走下田间,交通普法,共创文明