第一个Qt 程序

参考链接:

https://www.cnblogs.com/whik/p/12430281.html

另一个链接找不到了

 

新建一个控制台程序,存放在”nfs_rootfs”路径下

嵌入式Linux学习之路——第一个Qt程序

选择以下两个套件

嵌入式Linux学习之路——第一个Qt程序

 

main.cpp文件如下:

#include <QCoreApplication>

#include <iostream>

using namespace std;

int main(void)

{

    cout<<"hello world!"<<endl;

    return 0;

}

桌面端测试成功后,编译切换为开发板100ask_mp157构建套件, 点击底部锤子按钮,交叉编译这个工程,成功后输出的文件默认在当前工程目录的上一级会生成新目录。

如 build-hello_console-100ask_mp157-Debug

进入目录复制可执行文件到开发板,并运行

 

可通过file 命令查看文件类型

[[email protected]:~]# file helloworld

helloworld: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=b0263b48b325e11b57f510c94ea15112a9e9d246, for GNU/Linux 3.2.0, with debug_info, not stripped

 

相关文章: