当我想在我的电脑上制作gcc 4.1.2(ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.bz2)时ubuntu 12.04(x86_64)。当前活动的gcc是4.6.2。我做了:
./configure
然后
make
但是我得到这个错误
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: ld returned 1 exit status
在网络上搜索似乎的位置有问题crti
。这些文件在系统上可用
# find /usr/ -name crti*
/usr/lib32/crti.o
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib/debug/usr/lib/x86_64-linux-gnu/crti.o
还安装了libc6 devel软件包
# dpkg -l | grep libc6
ii libc6 2.15-0ubuntu10.3 Embedded GNU C Library: Shared libraries
ii libc6-dbg 2.15-0ubuntu10.3 Embedded GNU C Library: detached debugging symbols
ii libc6-dev 2.15-0ubuntu10.3 Embedded GNU C Library: Development Libraries and Header Files
ii libc6-dev-i386 2.15-0ubuntu10.3 Embedded GNU C Library: 32-bit development libraries for AMD64
ii libc6-i386 2.15-0ubuntu10.3 Embedded GNU C Library: 32-bit shared libraries for AMD64
ii libc6-pic 2.15-0ubuntu10.3 Embedded GNU C Library: PIC archive library
我该如何解决?
更新:
添加这些之后
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH
这个问题解决了。但是现在我明白了
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux- gnu/crtn.o' is incompatible with i386 output
collect2: ld returned 1 exit status
makeinfo
不存在,这是我的系统上。这些步骤无法解决您的错误。