环境:ubuntu16.04桌面环境。
配置交叉编译工具链
说明:使用ubuntu16.04桌面环境,安装QtCreator之后,再利用QtCreator开发QT5 GUI程序,如果编译的程序要运行在arm linux嵌入式系统中,则必须配置交叉编译工具链。
第一步:
source /opt/fsl-imx-x11/4.1.15-2.1.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
第二步:
主要配置内容:调试器、编译器、QT版本。
1、打开工具,点击选项。

2、选择选项中的构建与运行,概要界面。

3、构建套件(kit)界面。

4、Qt Versions界面。

5、编译器界面。

6、Debuggers界面。

7、Qbs界面。

8、交叉编译例子:
root@imhqq-B360M-D3V:/home/imhqq/share/huqiqiao/QtApp/qtmplay-02# pwd
/home/imhqq/share/huqiqiao/QtApp/qtmplay-02
root@imhqq-B360M-D3V:/home/imhqq/share/huqiqiao/QtApp/qtmplay-02# tree
.
├── main.cpp
├── main.o
├── mainwindow.cpp
├── mainwindow.h
├── mainwindow.h.autosave
├── mainwindow.o
├── mainwindow.ui
├── Makefile
├── moc_mainwindow.cpp
├── moc_mainwindow.o
├── moc_predefs.h
├── qtmplay-02
├── qtmplay-02.pro
├── qtmplay-02.pro.user
└── ui_mainwindow.h
0 directories, 15 files
root@imhqq-B360M-D3V:/home/imhqq/share/huqiqiao/QtApp/qtmplay-02#make clean
rm -f moc_mainwindow.cpp
rm -f ui_mainwindow.h
rm -f main.o mainwindow.o moc_mainwindow.o
rm -f *~ core *.core
root@imhqq-B360M-D3V:/home/imhqq/share/huqiqiao/QtApp/qtmplay-02# qmake
root@imhqq-B360M-D3V:/home/imhqq/share/huqiqiao/QtApp/qtmplay-02# tree
.
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
├── mainwindow.h.autosave
├── mainwindow.ui
├── Makefile
├── moc_predefs.h
├── qtmplay-02
├── qtmplay-02.pro
└── qtmplay-02.pro.user
0 directories, 10 files
9、上传单板验证。
qtmplay-02文件单独上传单板进行验证即可。

(完)
网友评论