linux 主机和开发板交叉编译

1. 主机:

main.c

查看代码

#include <stdio.h>

int main()
{

    printf("hello world!!\r\n");
    return 0;

}

2. 执行静态编译

arm-linux-gnueabihf-gcc main.c -o hello --static

3. 复制应用到开发板/home/root

scp ./hello  root@192.168.3.3:/home/root/

4. 开发板执行

root@myd-y6ull14x14:~# ./hello
hello world!!

 

posted @ 2024-09-01 16:52  微笑的''80  阅读(9)  评论(0)    收藏  举报