Firefly开源社区

Title: 如何编译.c文件 [Print This Page]

Author: caolingfeng    Time: 2018-5-30 10:02
Title: 如何编译.c文件
请教一下我用的是PX3SE如何在ubuntu下编译.c文件,用什么编译器编译
Author: Livvol    Time: 2018-5-30 10:17
用交叉编译工具链啊。
sudo apt-get install gcc-arm-linux-gnueabihf
Author: caolingfeng    Time: 2018-5-30 11:10
我试一下,多谢了!
Author: caolingfeng    Time: 2018-5-30 12:05
我使用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

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




Welcome Firefly开源社区 (http://account.t-firefly.com/) Powered by Discuz! X3.1