使用Qt Creator IDE+MSVC2015 32bit编译器组合,自行编译Qt Creator源码4.8.2版本

简介: 使用Qt Creator IDE+MSVC2015 32bit编译器组合,自行编译Qt Creator源码4.8.2版本

一、官方源码下载,qt-creator-opensource-src-4.8.2.zip


1、官方github源码


https://github.com/qt-creator/qt-creator Qt Creator源码


https://github.com/qt-creator/qt-creator/tree/master/src/plugins/designer Qt Creator的设计师插件


https://github.com/qt/qtbase Qt核心类源码


https://github.com/qt/qttools Qt工具类源码


https://github.com/qt/qttools/tree/dev/src/designer Qt设计师的源码


https://github.com/qt/qttools/tree/dev/src/windeployqt 依赖库工具源码


2、官方正式发行网站


http://download.qt.io/official_releases/qt/5.12/5.12.5/submodules/ qttools-opensource-src-5.12.5.zip,里面有Qt设计师的源码


http://download.qt.io/official_releases/qtcreator/4.8/4.8.2/ 我们从这里下载准备要编译的Qt Creator源码


3、编译声明


编译Qt设计师和编译Qt Creator,都要确保使用的Qt版本与之配套,否则会出错。


笔者的实践是:


(1)使用Qt 5.12.5+MSVC 2017 32bit版本,可以成功编译


qttools-opensource-src-5.12.5


qt-creator-opensource-src-4.8.2


(2)使用Qt 5.9.8+MSVC 2015 32bit版本,可以成功编译


qt-creator-opensource-src-4.8.2


接下来的内容,就举例(2)来讲解。



二、IDE和编译器准备


Qt Creator IDE和MSVC 2015编译器组合使用(不想完整安装VS2015)



三、编译源码qt-creator-opensource-src-4.8.2


其实Qt官方自己就是使用MSVC2015 32bit编译Qt Creator IDE的。为什么采用Visual Studio的msvc编译器,而不是MinGW的gcc编译器?因为前者比后者编译速度更快。一般来说Windows下就是MinGW的gcc和Visual Studio的nmake,在Windows下推荐使用MSVC编译器,能够加快编译速度。MinGW,其实它就是一个移植版本的GCC,的确是不如VC++快的。如果是其它平台,那么编译器可以换成LLVM的clang,那就快很多了。所以结论:在Windows平台还是尽量用MSVC编译器!




我们现在就来使用QtCreator编译QtCreator源码。(#^.^#)说起来有点饶舌。


使用Qt Creator IDE打开源码qt-creator-opensource-src-4.8.2文件夹里的qtcreator.pro,使用MSVC2015 32bit,开始编译,结果失败了,报错:


jom: D:\temp\build-qtcreator-Desktop_Qt_5_9_8_MSVC2015_32bit-Debug\src\Makefile [sub-libs-make_first-ordered] Error 2

jom: D:\temp\build-qtcreator-Desktop_Qt_5_9_8_MSVC2015_32bit-Debug\Makefile [sub-src-make_first-ordered] Error 2

21:34:20: 进程"D:\Qt\Qt5.9.8\Tools\QtCreator\bin\jom.exe"退出,退出代码 2 。

Error while building/deploying project qtcreator (kit: Desktop Qt 5.9.8 MSVC2015 32bit)

When executing step "Make"


然后在“构建和运行”,把“使用jom代替nmake”的勾选去掉。结果还是报错:


cd D:\temp\build-qtcreator-Desktop_Qt_5_9_8_MSVC2015_32bit-Debug\src\libs\botan\build && python D:\temp\qt-creator-opensource-src-4.8.2\src\libs\botan\..\3rdparty\botan\configure.py --cc=msvc --cc-bin=cl --cpu=x86 --amalgamation --minimized-build --disable-shared --enable-modules=aes,aes_ssse3,auto_rng,bigint,block,cbc,ctr,des,dh,dsa,ec_group,ecdh,ecdsa,entropy,filters,hmac,mode_pad,pubkey,rsa,sha1,sha1_sse2,sha1_x86,sha2_32,sha2_32_x86,sha2_64,simd,system_rng,emsa_pkcs1,pbes2,pbkdf2 --without-documentation --link-method=hardlink --debug-mode --cxxflags="-nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew /wd4100 /wd4800 /wd4127 /wd4244 /wd4250 /wd4267 /wd4334 /wd4702 /wd4996 /D_ENABLE_EXTENDED_ALIGNED_STORAGE"

'python' 不是内部或外部命令,也不是可运行的程序

或批处理文件。

NMAKE : fatal error U1077: 'cd' : return code '0x1'

Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'

Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2'

Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2'

Stop.

NMAKE : fatal error U1077: 'cd' : return code '0x2'

Stop.

21:19:02: 进程"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"退出,退出代码 2 。

Error while building/deploying project qtcreator (kit: Desktop Qt 5.9.8 MSVC2015 32bit)

When executing step "Make"

于是,上网找资料,找到了官方的说法:


https://wiki.qt.io/Building_Qt_Creator_from_Git


https://wiki.qt.io/Building_Qt_5_from_Git


Please also read README.md in the source tree.


我在\qt-creator-opensource-src-4.8.2\README.md,看到如下说明,看来编译Qt Creator源码需要安装perl和Python解释器。


## Compiling Qt Creator

Prerequisites:

* Qt 5.9.0 or later

* Qt WebEngine module for QtWebEngine based help viewer

* On Windows:

   * ActiveState Active Perl

   * MinGW with g++ 5.3 or Visual Studio 2015 or later

   * jom

   * Python 3.5 or later (optional, needed for the python enabled debug helper)

* On Mac OS X: latest Xcode

* On Linux: g++ 5.3 or later

* LLVM/Clang 6.0.0 or later (optional, needed for the Clang Code Model, see the

 section "Get LLVM/Clang for the Clang Code Model")

   * CMake (only for manual builds of LLVM/Clang)

* Python 2.6 or later (needed for building the bundled Botan library)

* Qbs 1.7.x (optional, sources also contain Qbs itself)

四、重整旗鼓,继续


1、环境准备,安装perl和python

https://www.activestate.com/products/perl/downloads/


ActivePerl-5.28 x64


Typical安装

Add perl to the PATH 勾选

perl -v


https://www.python.org/


Add Python 3.6 to PATH勾选

自定义安装,全选

Install for all users勾选


2、使用Qt Creator IDE,MSVC2015 32bit,打开源码的qtcreator.pro,没有什么需要额外设置的,直接构建即可。


debug和release分别编译,顺利完成。(#^.^#)



欢迎访问我的另一篇博客《在Windows和macOS平台,自主编译Qt Creator和Qt Designer源码》




-------


参考Qt的官方文献


https://wiki.qt.io/Building_Qt_Creator_from_Git


https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md


相关文章
|
IDE 开发工具
【开发IDE升级】如何对IDEA版本进行升级
本文介绍了如何将 IntelliJ IDEA Ultimate 从 2020.2.2 版本升级到 2022.3.2 版本。主要内容包括准备工作、卸载旧版本和安装新版本的步骤。首先,从官网下载所需版本并备份旧版配置;接着,通过 Uninstall.exe 卸载旧版,保留配置和插件;最后,安装新版并完成激活。详细的操作步骤和截图帮助用户顺利完成升级过程。
18940 1
【开发IDE升级】如何对IDEA版本进行升级
|
IDE 网络安全 开发工具
IDE之pycharm:专业版本连接远程服务器代码,并配置远程python环境解释器(亲测OK)。
本文介绍了如何在PyCharm专业版中连接远程服务器并配置远程Python环境解释器,以便在服务器上运行代码。
7247 0
IDE之pycharm:专业版本连接远程服务器代码,并配置远程python环境解释器(亲测OK)。
|
编解码 开发工具 UED
QT Widgets模块源码解析与实践
【9月更文挑战第20天】Qt Widgets 模块是 Qt 开发中至关重要的部分,提供了丰富的 GUI 组件,如按钮、文本框等,并支持布局管理、事件处理和窗口管理。这些组件基于信号与槽机制,实现灵活交互。通过对源码的解析及实践应用,可深入了解其类结构、布局管理和事件处理机制,掌握创建复杂 UI 界面的方法,提升开发效率和用户体验。
714 13
|
Windows
QT源码拾贝6-11(qwindowswindow)
这篇文章深入探讨了Qt源码中与窗口激活相关的函数,QDebug运算符重载,vscode的变量提示,Windows常用类型名,获取所有窗体的方法,以及QSharedPointer智能指针的使用。
647 0
QT源码拾贝6-11(qwindowswindow)
|
存储 Java C++
QT源码拾贝0-5(qimage和qpainter)
这篇文章介绍了在Qt源码中qimage和qpainter的使用,包括线程池的使用、智能指针的存储、std::exchange函数的应用、获取类对象的方法以及QChar字节操作。
400 0
QT源码拾贝0-5(qimage和qpainter)
|
IDE 开发工具 C++
qt creator + vs2019编译记录
本文记录了作者在使用qt creator和vs2019编译项目时遇到的困难和解决方案,包括编译环境设置、qt creator编译脚本的成功案例、不带Ninja的编译脚本问题、错误示范以及相关参考链接。
925 0
qt creator + vs2019编译记录
关于linux的qt发布(linuxdeployqt)中opengl版本过高的解决
关于linux的qt发布(linuxdeployqt)中opengl版本过高的解决
|
JSON 自然语言处理 网络协议
基于QT实现的词典(附源码)
主要用到的技术:JSON字符串,堆栈窗体(方便以后加新功能),QTcpSocket,LcdNumber,时间戳的转换。 通信用的是TCP通信,将TCP封在了一个头文件中,哪个文件想去通过TCP链接发送消息就可以使用头文件 QT端写的是客户端,服务器还是在我笔记上次的Linux系统下写的服务器,做了一些小修改
507 1
Qt安装之后添加或移除组件(Qt Creator 10.0.1)
Qt安装之后添加或移除组件(Qt Creator 10.0.1)
2569 2

推荐镜像

更多
  • qt