1、編譯環(huán)境
操作系統(tǒng)直接是官方的Debian。
root@orangepizero2:~# uname -a Linux orangepizero2 5.16.17-sun50iw9 #3.0.8 SMP Sat Apr 15 13:13:46 CST 2023 aarch64 GNU/Linux root@orangepizero2:~#
gcc也自帶了,手癢升級(jí)了下。
root@orangepizero2:~# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.1 20210110 (Debian 10.2.1-6)
2、hello world
簡(jiǎn)單來(lái)個(gè)hello MangoPi!
#include #include int main(void) { int i; for(i = 0; i < 5; i++) { printf("hello MangoPi! n"); } return 0; }
執(zhí)行g(shù)cc hello.c后會(huì)生成可執(zhí)行文件a.out,熟悉的名字。
root@orangepizero2:~# gcc hello.c root@orangepizero2:~# ls a.out hello.c root@orangepizero2:~#
喜歡學(xué)習(xí)的可以看看。
3、程序運(yùn)行
程序執(zhí)行后,符合預(yù)期。
-
程序
+關(guān)注
關(guān)注
117文章
3825瀏覽量
82690 -
編譯程序
+關(guān)注
關(guān)注
0文章
13瀏覽量
4197
發(fā)布評(píng)論請(qǐng)先 登錄
【免費(fèi)試用22期】芒果派MangoPi MQ Quad
【芒果派MangoPi MQ Quad】+初次刷機(jī)
【芒果派MangoPi MQ Quad】開(kāi)箱與Debian系統(tǒng)體驗(yàn)
【芒果派MangoPi MQ Quad】安卓10系統(tǒng)體驗(yàn)
【芒果派MangoPi MQ Pro】+系統(tǒng)安裝及編程測(cè)試
【芒果派MangoPi MQ Quad】開(kāi)箱+資料準(zhǔn)備
【芒果派MangoPi MQ Pro】+ 交叉工具鏈配置
【芒果派MangoPi MQ Quad】開(kāi)箱+系統(tǒng)測(cè)試
【芒果派MangoPi MQ Quad】基于芒果派MangoPi MQ Quad編譯程序執(zhí)行
【芒果派MangoPi MQ Quad】Android10的體驗(yàn)
【芒果派MangoPi MQ Quad】開(kāi)箱+系統(tǒng)測(cè)試

評(píng)論