我已经使用本教程创建了amhello-1.0.tar.gz单击以打开
现在正在尝试进行交叉编译,但是会发生错误。我正在按照本教程单击以打开
输入make
命令后发生错误
hp@ubuntu:~/amhello-1.0$ make
make all-recursive
make[1]: Entering directory `/home/hp/amhello-1.0'
Making all in src
make[2]: Entering directory `/home/hp/amhello-1.0/src'
i586-mingw32msvc-gcc -g -O2 -o hello.exe main.o
main.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make[2]: *** [hello.exe] Error 1
make[2]: Leaving directory `/home/hp/amhello-1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/hp/amhello-1.0'
make: *** [all] Error 2
看起来您正在重新使用与原始本机构建相同的构建目录来进行交叉编译。“ make”程序不知道您已经更改了工具链,并且不认为目标文件(main.o)已过时-因此它不会尝试重新编译它,而是直接跳转到链接步骤-失败,因为它试图将本机ELF对象与外部(mingw)库链接。
尝试在之前执行make clean
或rm src/*.o
,make
以强制完全重新编译。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句