我有CentOS 7.2 1511(gcc 4.8.5 20150623(Red Hat 4.8.5-4)),並且一直試圖從gnu網站下載gcc 6.2.0。以下是我得到的錯誤:gcc編譯錯誤6.2
checking for x86_64-pc-linux-gnu-gcc... /home/xxx/gcc-6.2.0/build/./gcc/xgcc -B/home/xxx/gcc-6.2.0/build/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/home/xxx/gcc-6.2.0/build/x86_64-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/xxx/gcc-6.2.0/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/xxx/gcc-6.2.0/build'
make: *** [all] Error 2
,展望x86_64的-PC-Linux的GNU/libgcc的/的config.log文件:
configure:3435: /home/xxx/gcc-6.2.0/build/./gcc/xgcc -B/home/xxx/gcc-6.2.0/build/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3446: $? = 1
configure:3435: /home/xxx/gcc-6.2.0/build/./gcc/xgcc -B/home/xxx/gcc-6.2.0/build/./gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -qversion >&5
xgcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
xgcc: fatal error: no input files
compilation terminated.
發生了什麼事嗎?我遵循的程序爲「MKDIR構建; CD構建」,然後發出如下configure命令:從(感謝奧列剋剋拉夫丘克)的
../configure --disable-multilib --enable-languages=c,c++ --with-system-zlib --with-default-libstdcxx-abi=gcc4-compatible
[Compilng libgcc xgcc error]可能的重複(http://stackoverflow.com/questions/16076660/compilng-libgcc-xgcc-error) –
不,不是。正如你所看到的,我的錯誤是「-V」,-qversion,甚至在修改配置後,還有其他錯誤來自超出行號3600 ++。讓我以菲利普方法的精神解決錯誤。 –
配置中的錯誤意味着會發生,這就是配置的工作原理,它會嘗試一些事情,直到找出有效的方式。真正的問題可能在以後的config.log中。 –