​

为了便于与嵌入式linux系统的QT编译环境系统相匹配,我们使用了QT4.8.5的编译环境。你也可以使用其他版本的软件,QT4大致的安装步骤都是一样的,可以参考。

本搭建环境在window 32/64皆可使用。有以下四个文件,可以在网上直接搜到,这里就不提供下载地址了。

如图所示共有四个文件 其中两个exe文件是需要安装的。

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_QT

安装步骤如下:

1) 将两个压缩文件直接解压到当前文件夹,MinGW-gcc440_1.zip , qtcreator-gdb-7.4-MINGW32_NT-6.1-i686.tar.gz 解压后如图所示,箭头指向解压后的文件。

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_02

我把所有的文件都安装在D盘的qt文件夹下路径是D:/qt  所以需要把刚才解压后的两份文件放入新建文件中。

2) 安装qt 4.8.5 双击exe的界面,一路Next下去。

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_03

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_04

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_05

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_06

 此时要选对你要安装的路径D:\qt\4.8.5 点击NEXT,然后接着next下去,如图所示:

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_07

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_QT_08

此时Find installed MinGW 要找到我们之前复制过来的mingw 文件夹,然后点击install

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_09

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_QT_10

最终点击Finish完成4.8.5的安装。

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_11

3)接下来安装Qt Creator 2.8.0.双击qt-creator-windows-opensource-2.8.0.exe 文件,点击下一步,选择Qt Creator的文件夹路径我们这里选择d:\qt\qtcreator-2.8.0

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_QT_12

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_13

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_14

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_15

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_16

4)软件安装完成后,需要对软件进行配置,点击菜单栏的工具按钮,选中其中的选项,在跳出来的 选项窗口中选中 构建和运行 手动设置 如下信息

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_17

调试器我们要选中我们之前拷贝到D盘qt文件夹下的qtcreator-gdb-7.4-MINGW32_NT-6.1-I686下的 gdb-i686-pc-mingw32.exe

Qt版本选择如下图:

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_18

 编译器的选择如下图:

 

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_QT_19

 

应用, 然后确定,至此环境配置弯成,可以编辑一个hello world来测试一下功能是否完善。

小伙伴可以愉快地开始编程之路了!

环境变量设置:

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_20

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_Qt_21


系统变量设置:

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_22

以上环境变量设置完毕重启软件,即可生效。

就不会再提示  “没有这个QT版本的编译器,请选择一个或者多个

另外编译通过后,调试会出现遇到的一个问题:

Failed to start program. Path or permissions wrong?

win10 64  PC 端 Qt Creator 安装+Qt4.8.5+MinGW编译器+GDB调试器_编译器_23

这个一般是配置编译器路径错误或者权限不够。再者就是该执行文件不能在该平台上运行。

 ​