Print Previous Topic Next Topic

[技术讨论] 如何编译.c文件

64

Credits

0

威望

0

贡献

技术小白

Credits
64

【技术讨论】 如何编译.c文件

Posted at 2018-5-30 10:02:36      浏览:7164 | 回复:3        打印      只看该作者   [复制链接] 楼主
请教一下我用的是PX3SE如何在ubuntu下编译.c文件,用什么编译器编译
Reply

Use props Report

888

Credits

4

威望

0

贡献

技术大神

Rank: 3Rank: 3

Credits
888
Posted at 2018-5-30 10:17:15        只看该作者  沙发
用交叉编译工具链啊。
sudo apt-get install gcc-arm-linux-gnueabihf
Reply

Use props Report

64

Credits

0

威望

0

贡献

技术小白

Credits
64
Posted at 2018-5-30 11:10:56        只看该作者  板凳
我试一下,多谢了!
Reply

Use props Report

64

Credits

0

威望

0

贡献

技术小白

Credits
64
Posted at 2018-5-30 12:05:37        只看该作者  地板
我使用gcc-arm-linux-gnueabihf交叉编译工具链,编译C文件出现
arm-linux-gnueabihf-gcc main.o sha_256.o -o app -lpthread
main.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:3: recipe for target 'app' failed
用file main.o,查看属性如下:
main.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

这如何解决呀,劳烦请指教
Reply

Use props Report

You need to log in before you can reply Login | 立即注册

This forum Credits Rules

Quick Reply Back to top Back to list