Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux 程式設計 >> Linux 程式設計

Tiny6410 交叉編譯第一課:helloworld

在工作目錄下建立 helloworld.c:

#include <stdio.h>

main()
{
    printf("helloworld!\n");
}

存檔關閉後,用交叉編譯器把它編成 ARM 可執行檔:

root@www.linuxidc.com:/home/workdir/qt/project/helloworld# arm-linux-gcc helloworld.c -o helloworld

接著把產生的 helloworld 複製到開發板的文件系統目錄中並執行,終端機就會印出 helloworld!。

這就是最基礎的交叉編譯流程:主機上編譯、目標板上執行。後續所有嵌入式開發,都建立在這個起點之上。

Copyright © Linux教程網 All Rights Reserved