This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

The "cannot open crt1.o" problem

Recently, I decided to install GCC onto Linux 2.2.12, which I did using the 
RPM package egcs-1.1.2-24.i386.rpm. However, when I attempted to compile 
and link a C program, I received the error message

      /usr/bin/ld: cannot open crt1.o: No such file or directory

I discovered that the RPM package had placed the object files for the 
linker in the subdirectory /usr/i386-glibc20-linux/lib; therefore, I added 
the flag -L/usr/i386-glibc20-linux/lib so that the linker could locate the 
files. However, even with this flag in place, I was still getting the above 
error message, in spite of the fact that crt1.o is present in subdirectory 

I got round the problem by placing the standard object files in usr/bin/lib 
by installing the glibc-devel RPM package (and the associated 
kernel-headers package).

A search on the Web has revealed that lots of people have fallen victim to 
the problem of trying to link crt1.o when it is not located in 
/usr/bin/lib. Is it a problem with the use of the -L flag, or is it 
something to do with the linker's perception of crt1.o even when the flag 
is present?

Richard Dybowski, 143 Village Way, Pinner, Middlesex  HA5 5AA, UK
Tel (mobile): 079 76 25 00 92

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]