在ubuntu 11.10下编译gcc 4.6.2时出错

Sha*_*zad 11 ubuntu gcc

我在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'
Run Code Online (Sandbox Code Playgroud)

我也试过设置LD_LIBRARY_PATH但没有用.

提前致谢.

Fre*_*Foo 30

显然,你的LIBRARY_PATH结局是冒号:

/usr/lib/x86_64-linux-gnu/:
#  -----------------------^
Run Code Online (Sandbox Code Playgroud)

摆脱它:

export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
Run Code Online (Sandbox Code Playgroud)

  • 提示:如果那个愚蠢的冒号发生了,[你别忘了检查`C_INCLUDE_PATH`](http://stackoverflow.com/a/13874779/321973) (2认同)
  • 在我的系统上,冒号位于开头,所以也检查一下 (2认同)