DSP-Sitara课程学习分享8--QT入门
[复制链接]
在Sitara SDK中,/ti-sdk-am335x-evm-05.05.00.00/linux-devkit/arm-arago-linux-gnueabi/usr/lib目录下,有Qt相关的库文件,如图:
当你编译或者运行Qt工程时,会用到这些库文件。
Qt的相关头文件:
执行以下命令以源代码环境安装脚本
echo $QMAKESPEC source /home/qinkai/ti-sdk-am335x-evm-05.05.00.00/linux-devkit/environment-setup echo $QMAKESPEC
注意提示有所变化。
开始建立第一个Qt工程:
1.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/linux-devkit> mkdir /home/qinkai/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld
2.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00> cd example-applications/
3.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications> ls
am-benchmarks-1.3 helloworld matrix-gui-browser-2.0 qt-tstat-1.0
am-sysinfo-1.0 matrix-gui-2.0 qml-playground-1.0 refresh-screen-1.0
4.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications> cd helloworld/
5.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld> gedit helloworld.cpp
添加如下代码:
#include #include int main(int argc, char **argv){QApplication app(argc,argv);QLabel label("Hello World");label.show();return app.exec();}
6.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld> gedit helloworld.pro
添加如下代码:
QT += core guiSOURCES += helloworld.cpp
7.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld> qmake helloworld.pro // 创建Makefile文件
8.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld> make
9.[linux-devkit]:~/ti-sdk-am335x-evm-05.05.00.00/example-applications/helloworld> file helloworld
helloworld: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
10.把helloword文件拷贝到板子上 执行命令./helloworld -qws
hellow参考资料
sitara_boot_camp_linux_gui_development.pptx
(4.09 MB, 下载次数: 327)
|