瑞芯微Rockchip开发者社区
登录
直播中
郑成枝
8年用户
1385经验值
私信
关注
[问答]
如何去编译一个hello world的C程序呢
开启该帖子的消息推送
C程序
二进制
编译器
请问一下,是否需要把自己写的应用程序放到app目录下,然后按照5.6节“单独编译app程序”,获得二进制可执行文件吗?还是可以用某个编译器,使用makefile文件直接编译我自己写的应用程序代码?谢谢!
例如我想写一个打印hello world的C程序,应该如何进行编译?谢谢!
回帖
(1)
金果子
2022-1-5 10:34:35
可以用交叉编译进行编译;
交叉编译helloworld:
forlinx@ubuntu:~/hello$
aarch64-linux-gnu-gcc hello.c -o helloworld
forlinx@ubuntu:~/hello$
ls
hello hello.c helloworld
forlinx@ubuntu:~/hello$
file helloworld
helloworld: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=cbbb36ff5a597e7883cd1a639cccc2aa34584585, not stripped
可以用交叉编译进行编译;
交叉编译helloworld:
forlinx@ubuntu:~/hello$
aarch64-linux-gnu-gcc hello.c -o helloworld
forlinx@ubuntu:~/hello$
ls
hello hello.c helloworld
forlinx@ubuntu:~/hello$
file helloworld
helloworld: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=cbbb36ff5a597e7883cd1a639cccc2aa34584585, not stripped
举报
更多回帖
rotate(-90deg);
回复
相关问答
C程序
二进制
编译器
如何
去
实现
一
种基于UP_CUP6410开发板的
Hello
world
程序
设计
呢
2021-12-27
1082
怎样
去
编写
一
个
Hello
World
的Arm汇编指令
呢
2021-10-22
1249
如何在宿主机和开发板上去实现
一
个
Hello
world
的
程序
呢
2021-12-27
1187
vscode
编译
hello_world
存在问题,这个怎么解决?
2023-02-21
445
编译
项目
Hello_World
时出现报错的原因?
2023-03-02
481
如何得到
一
个
“
hello
World
\r\n15536”的输出?
2019-08-16
2431
根据书上教程在eclipse环境下
hello_world
程序
编译
成功,但是烧写报错,是什么原因?
2025-11-07
1102
ello
World
控制台输入 -
hello_world.c
:50上的GETCHAR() 未收到输入值是怎么回事?
2023-04-21
547
RA-RTT体验RT-Thead超级简单的
hello
world
2023-02-22
645
rt1170烧录
hello
world
程序
后,
程序
无法运行的原因?
2023-03-24
645
发帖
登录/注册
20万+
工程师都在用,
免费
PCB检查工具
无需安装、支持浏览器和手机在线查看、实时共享
查看
点击登录
登录更多精彩功能!
首页
论坛版块
小组
免费开发板试用
ebook
直播
搜索
登录
×
20
完善资料,
赚取积分