安装linux里gcc时出现错误,安装错误的gcc导致一些错误
出现如下错误:make:arm-linux-gnueabihf-gcc:Commandnotfound CHKinclude/generated/uapi/linux/version.hCHKinclude/generated/utsrelease.hCCscripts/mod/empty.o/bin/sh:1:arm-linux-gnueabihf...
出现如下错误:
make: arm-linux-gnueabihf-gcc: Command not found CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
/bin/sh: 1: arm-linux-gnueabihf-gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: `include/generated/mach-types.h' is up to date.
make: *** [scripts] Error 2
首先怀疑gcc没有安装,但是输入gcc -v也有显示版本号。在此建立软连接ln -s x86_64-linux-gnu-gcc-4.8 arm-linux-gnueabihf-gcc 后出现如下错误:
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mlittle-endian’
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
CC scripts/mod/devicetable-offsets.s
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
arm-linux-gnueabihf-gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
arm-linux-gnueabihf-gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mlittle-endian’
arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
make -j10 [ERROR] 2
经大神指点,安装的gcc版本有误。
解决:
apt-get remove gcc
sudo apt-get install gcc-arm-linux-gnueabihf
vi /etc/profile
最后加入export PATH=$PATH:/usr/bin
source /etc/profile
再次出现错误:/bin/sh: 1: g++ not found
解决办法:sudo apt-get install g++
更多推荐
所有评论(0)