Qt源代码编译
参考:windows搭建Qt源码编译、调试环境_qt源码编译安装_超级大洋葱806的博客-优快云博客
创建三个文件夹,build、install、src,将qt源码解压放在src,进入build文件夹
1.MinGW
1.1下载MinGW
1.2切到qt源码路径,执行
configure -prefix "qt源码路径" -debug -opensource –static -static-runtime -force-debug-info -opengl dynamic -opengl desktop -platform win32-g++ -c++std c++11 -skip qtwebengine -nomake examples -nomake tests -mp -confirm-license
1.3配置完成,执行 mingw32-make -j16
多线程编译命令
1.4编译完成,执行 mingw32-make install -j16
安装命令
1.5在qt creator中添加qmake路径
2.MSVC
2.1下载VS,配置C++环境
2.2启动VS命令行,编译配置
configure -prefix D:\QT6_x64\ -debug-and-release -opensource
2.3编译源码
cmake --build . --parallel
2.4安装qt库
cmake --install .