LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-04-2013, 04:44 AM   #1
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Rep: Reputation: 16
Question Gcc 4.7. ld: cannot find crt1.o


Hi guys
when i'm trying to compile any program with gcc I'm getting an error :
Code:
gcc -o test dummy.c
/usr/bin/ld: cannot find crt1.o: No such file or directory
collect2: error: ld returned 1 exit status
I'm using old 32-bit Pentium 4, 1Gb of memory
Debian GNU/Linux 6.0(Squeeze).
I've tried to search answer with Google. All I've found is a suggestion to make link
Code:
ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
which I've done. Other thing was to install libc6-dev, I did it, but still getting that error from Gcc
Code:
gcc						install
gcc-4.1-base					install
gcc-4.3-base					install
gcc-4.4-base					install
gcc-4.7						install
gcc-4.7-base					install
gcc-4.7-multilib				install
gcc-multilib					install
libc6						install
libc6-dev					install
I have a feeling that it's somehow connected to Debian multiarch approach but i can't figure it out.
 
Old 05-04-2013, 09:42 PM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,675

Rep: Reputation: 122Reputation: 122
Remove the sym-link you've made and install the libc6-dev-amd64 package.
 
Old 05-04-2013, 11:33 PM   #3
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
libc6-dev-amd64 is installed, and /usr/lib64 no longer a symlink. but Gcc still not working
 
Old 05-05-2013, 04:32 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,670

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545
# 1 .

gcc-4.7** : How did you install the "4.7" packages ?
( They are not Debian 6 packages.)

If you have used some Debian 7 Wheezy packages :
Did you also install Debian 7 libc6 packages ?

7 Wheezy : The 'crt1.o' location = /usr/lib/i386-linux-gnu/crt1.o

-
 
Old 05-05-2013, 02:27 PM   #5
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by knudfl View Post
# 1 .

gcc-4.7** : How did you install the "4.7" packages ?
( They are not Debian 6 packages.)

If you have used some Debian 7 Wheezy packages :
Did you also install Debian 7 libc6 packages ?

7 Wheezy : The 'crt1.o' location = /usr/lib/i386-linux-gnu/crt1.o

-
The same problem occurred with gcc-4.1 4.3
 
Old 05-05-2013, 02:47 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,670

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545
# 5 .

You did not answer the questions in post #5.

? Did you install any of those Debian 7 Wheezy packages ?

? What is the reply from $ dpkg -s libc6-dev <Enter>


-
 
Old 05-05-2013, 02:55 PM   #7
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
Quote:
Did you install any of those Debian 7 Wheezy packages ?
Yes, i did.



Maybe this will shed light on Gcc's bad behavior

Code:
gcc -v dummy.c 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --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.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5) 
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i586'
 /usr/lib/gcc/i486-linux-gnu/4.7/cc1 -quiet -v -imultiarch i386-linux-gnu dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=i586 -auxbase dummy -version -o /tmp/cc51KMCN.s
GNU C (Debian 4.7.2-5) version 4.7.2 (i486-linux-gnu)
	compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129246
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i486-linux-gnu/4.7/include
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.7/include-fixed
 /usr/include/i386-linux-gnu
 /usr/include
End of search list.
GNU C (Debian 4.7.2-5) version 4.7.2 (i486-linux-gnu)
	compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129246
Compiler executable checksum: 86d53dcb5a2b688dea58f7b6bd2d835d
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i586'
 as -v --32 -o /tmp/ccowZvoN.o /tmp/cc51KMCN.s
GNU assembler version 2.22 (i486-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22
COMPILER_PATH=/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i586'
 /usr/lib/gcc/i486-linux-gnu/4.7/collect2 --sysroot=/ --build-id --no-add-needed --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 crt1.o /usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i486-linux-gnu/4.7/crtbegin.o -L/usr/lib/gcc/i486-linux-gnu/4.7 -L/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu -L/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.7/../../.. /tmp/ccowZvoN.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i486-linux-gnu/4.7/crtend.o /usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o
/usr/bin/ld: cannot find crt1.o: No such file or directory
collect2: error: ld returned 1 exit status

Last edited by openmind; 05-05-2013 at 03:00 PM.
 
Old 05-05-2013, 03:02 PM   #8
openmind
Member
 
Registered: Feb 2010
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: 16
Code:
dpkg -s libc6-dev


Package: libc6-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 17964
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: i386
Source: eglibc
Version: 2.13-38
Provides: libc-dev
Depends: libc6 (= 2.13-38), libc-dev-bin (= 2.13-38), linux-libc-dev
Recommends: gcc | c-compiler
Suggests: glibc-doc, manpages-dev
Breaks: binutils (<< 2.20.1-1), binutils-gold (<< 2.20.1-11), cmake (<< 2.8.4+dfsg.1-5), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2), gcc-4.6 (<< 4.6.0-12), libhwloc-dev (<< 1.2-3), libjna-java (<< 3.2.7-4), liblouis-dev (<< 2.3.0-2), liblouisxml-dev (<< 2.4.0-2), make (<< 3.81-8.1), pkg-config (<< 0.26-1)
Conflicts: libc0.1-dev, libc0.3-dev, libc6.1-dev
Description: Embedded GNU C Library: Development Libraries and Header Files
 Contains the symlinks, headers, and object files needed to compile
 and link programs which use the standard C library.
Multi-Arch: same
 
Old 05-05-2013, 05:11 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,670

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545
# 8 .
Quote:
dpkg -s libc6-dev
.
Version: 2.13-38
OK, thats an alien Wheezy package in a Debian 6 Squeeze OS.

Which means that you still have the "Squeeze LD_LIBRARY_PATH".

And before any compilation with any gcc or g++ you will have to do :
export LD_LIBRARY_PATH=$PATH:/usr/lib/i386-linux-gnu/

Be aware that the export command is temporary.
Will return to default when you exit the terminal.

-

Last edited by knudfl; 05-05-2013 at 05:13 PM.
 
  


Reply

Tags
debiansoftware, gcc, ld


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc Error ,executing .c file-> crt1.o not found Santoshkb Linux - Server 5 06-23-2012 04:49 AM
command to make crt1.o from a crt1.S manoj7410 Linux - Embedded & Single-board computer 1 06-12-2012 03:12 AM
can link with crt1.o error. wolver Linux From Scratch 0 01-16-2005 09:02 AM
Where do I find 'crt1.o' and 'crtn.o' for gcc 3.4.1 ? Qwirt Linux - Software 1 07-28-2004 06:08 PM
crt1.o / glibc-devel chris17 Slackware 3 07-26-2003 02:28 PM


All times are GMT -5. The time now is 07:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration