2011-10-19 113 views
0

現在,我在使用ubuntu 11.10中的gcc4.6工作時遇到了困難。在分發升級之前,所有鏈接都正常,並且仍然在其他開發人員計算機上編譯/鏈接。如果相關,我不想交叉編譯。操作系統分發升級後Gcc未鏈接

目前編譯通過,則連接失敗,出現以下:

/usr/bin/ld: error: cannot open crt1.o: No such file or directory 
/usr/bin/ld: error: cannot open crti.o: No such file or directory 
/usr/bin/ld: error: cannot open crtn.o: No such file or directory 
collect2: ld returned 1 exit status 
make: *** [mc] Error 1 

下面是關於我在用的一些信息:

$gcc -v 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) 

$ ldd --version 
ldd (Ubuntu EGLIBC 2.13-20ubuntu5) 2.13 
Copyright (C) 2011 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
Written by Roland McGrath and Ulrich Drepper. 

$ find /usr -name "crt1.o" 
/usr/arm-linux-gnueabi/lib/crt1.o 
/usr/lib32/crt1.o 
/usr/lib/x86_64-linux-gnu/crt1.o 
/usr/lib/debug/usr/lib32/crt1.o 
/usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o 
/usr/arm-linux-gnueabihf/lib/crt1.o 

是否有某種方式來指向的方向LD2 crt1.o文件?

如有需要,歡迎發佈任何其他信息!

+0

您是否嘗試過安裝/升級'libc6的-dev'? [http://anaaman.blogspot.com/2006/01/crt1o-no-such-file-no-such-file-or.html](http://anaaman.blogspot.com/2006/01/crt1o- no-such-file-no-such-file-or.html) – ks1322

+0

@ ks1322,是的,我已經安裝了。 – shuttle87

+0

它看起來像所有這些都在/ usr/lib/x86_64-linux-gnu /我該如何告訴ld鏈接到那些? – shuttle87

回答

0

我很久以前就解決了這個問題,但希望發佈這可以幫助別人。 所有必需的.o文件都已安裝,但我已安裝的gcc 4.6的ppa版本正在爲他們尋找錯誤的位置。重新安裝官方倉庫中的所有軟件包解決了這個問題。

確保您可以訪問正確的信息庫,則:

sudo apt-get update 
sudo apt-get install --reinstall binutils 
sudo apt-get install --reinstall build-essential 
sudo apt-get install --reinstall libc6-dev 
sudo apt-get install --reinstall gcc-4.6 
相關問題