我在ubuntu 11.10下编译gcc 4.6.2有一个问题 . 这个错误很流行,即/ usr / bin / ld:找不到crti.o:没有这样的文件或目录我试过LIBRARY_PATH = / usr / lib / x86_64-linux-gnu其中crti.o可以被链接器找到但是然后配置抱怨LIBRARY_PATH在构建gcc时不应包含当前目录的路径
checking LIBRARY_PATH variable... contains current directory
configure: error:
*** LIBRARY_PATH shouldn't contain the current directory when
*** building gcc. Please change the environment variable
*** and run configure again.
make[2]: *** [configure-stage2-gcc] Error 1
make[2]: Leaving directory `/home/abdul/cc02/gcc-4.6.2/src-infra/obj-gcc'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/abdul/cc02/gcc-4.6.2/src-infra/obj-gcc'
我也试过设置LD_LIBRARY_PATH但没有用 .
提前致谢 .
4 回答
显然,你的
LIBRARY_PATH
以冒号结尾:摆脱它:
结合@hmb,@ FredFoo的答案,并避免对用户系统的假设:
看来你的
LD_LIBRARY_PATH
以冒号结尾,GCC不赞同 . 你还应该确保C_INCLUDE_PATH
不知道如何做到这一点:然后重新配置构建(使用
configure -v
) .我有同样的问题,并在askubuntu找到了解决方案 .
特别是在以下评论中:
以下命令解决了问题
unset LIBRARY_PATH; ./configure -v