Visual Studio2017源码编译Qt5.12.12

一、编译准备

①Qt5.12.12源码下载 点击下载
②ActivePerl 5.24 点击下载
③Python 2.7 点击下载
④Ruby 3.0.3 点击下载
⑤Visual Studio2017 点击下载
如果您着急使用Qt5.12.12开发库,又不想花费而外的经历自行编译,那么您可以在文章结尾直接下载笔者已经编译好的Qt5.12.12的32位和64位开发库!

二、编译设置

1、修改配置文件
进入源码下qtbase\mkspecs\common目录,打开配置文件,进行修改
***原始配置文件******修改后配置文件***
2、打开Vs命令行,切换至Qt5源码根目录
在这里插入图片描述

3.Configure配置命令

configure  -prefix "D:\qt5.12.12" -confirm-license -opensource  -debug-and-release -platform win32-msvc  -nomake examples -nomake tests  -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -mp

在这里插入图片描述
在这里插入图片描述
4、开始编译,执行nmake命令

nmake

在这里插入图片描述
5、安装Qt开发库,执行nmake install命令

nmake install

在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
6、预编译库下载
64位预编译库:点击下载
32位预编译库:点击下载

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
编译 Qt 5.12.12 源码需要一些准备工作,包括安装必要的依赖项、下载源代码等。以下是编译 Qt 5.12.12 源码的基本步骤: 1. 安装必要的依赖项 在 Ubuntu Linux 系统中,可以使用以下命令安装必要的依赖项: ``` sudo apt-get update sudo apt-get install build-essential perl python git sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libcap-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev gperf bison ``` 在 Windows 系统中,需要安装 Visual Studio、Python、Git 和 Perl 等软件,并设置好环境变量。具体安装步骤可以参考 Qt 官方文档。 2. 下载 Qt 5.12.12 源代码 可以在 Qt 官网下载 Qt 5.12.12 的源代码,也可以使用 Git 命令行工具从 GitHub 上下载源代码: ``` git clone git://code.qt.io/qt/qt5.git -b 5.12.12 ``` 3. 配置编译参数 进入 Qt 源代码目录,执行以下命令配置编译参数: ``` ./configure -prefix /usr/local/qt512 \ -opensource \ -confirm-license \ -release \ -shared \ -no-pch \ -no-icu \ -no-cups \ -no-harfbuzz \ -no-fontconfig \ -no-glib \ -no-gtk \ -no-kms \ -no-directfb \ -no-mirclient \ -no-xcb \ -no-xinput2 \ -no-xcb-xlib \ -no-xkbcommon-x11 \ -no-eglfs \ -no-gbm \ -no-linuxfb \ -no-mtdev \ -no-evdev \ -no-libudev \ -no-system-proxies \ -no-gstreamer \ -no-vulkan \ -no-opengl \ -no-openvg \ -no-gif \ -no-jasper \ -no-libjpeg \ -no-libpng \ -no-libwebp \ -no-tiff \ -no-sql-mysql \ -no-sql-psql \ -no-sql-sqlite \ -no-sql-odbc \ -no-sql-ibase \ -no-sql-tds \ -no-openssl \ -no-compile-examples \ -no-qt3d \ -no-qtactiveqt \ -no-qtcanvas3d \ -no-qtdatavis3d \ -no-qtgamepad \ -no-qtlocation \ -no-qtpurchasing \ -no-qtwebglplugin \ -no-qtwebengine \ -no-qtwebview \ -no-qtserialbus \ -no-qtserialport \ -no-qttools \ -no-qtwayland \ -no-qtwebsockets \ -no-qtwebchannel \ -no-qtwebview \ -no-qtremoteobjects \ -no-qtscript \ -no-qtscxml \ -no-qtsensors \ -no-qtspeech \ -no-qtvirtualkeyboard \ -no-qtxmlpatterns \ -no-qml-debug \ -no-qml-debugger \ -no-qml-import \ -no-qml-debugger \ -no-qmltestrunner \ -no-quick \ -no-quickcontrols \ -no-quickcontrols2 \ -no-webkit \ -no-widgets \ -no-accessibility \ -no-qt-ltcg \ -no-dbus \ -no-system-freetype \ -no-iconv \ -no-pcre \ -no-feature-bearermanagement ``` 上述配置参数中,包含了几乎所有的 Qt 模块和依赖项,但都设置为不编译。如果需要编译某个模块,可以将其对应的 `-no-xxx` 参数改为 `-xxx`。 4. 编译源代码 执行以下命令编译 Qt 源代码: ``` make -j4 ``` 其中 `-j4` 参数表示使用 4 个并行编译任务,可以根据机器的 CPU 核心数自行调整。 5. 安装 Qt 执行以下命令将 Qt 安装到指定目录: ``` sudo make install ``` 安装完成后,可以使用 `/usr/local/qt512/bin/qmake` 命令来验证 Qt 是否安装成功。 以上是基本的 Qt 5.12.12 源码编译步骤。如果需要编译某个 QML 模块或 LOCATION 模块,可以在配置编译参数时开启对应的模块,具体方法可以参考 Qt 官方文档。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值