View Full Version : gcc compilation problems

6th January 2007, 06:59 AM
I'm not able to compile C or C++ programs using gcc or g++. My gcc version is 4.1.1-30. The error message is as follows:
[root@digjam tmp]# gcc test.c
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

I tried installing older versions of gcc but that did not help one bit. I also tried using the -march option; but even that didn't help.
Can you help me out? [I suspect the problem's got to do with my OS rather than my gcc - that's why i'm posting on this topic]

6th January 2007, 09:42 AM
The problem is that it can't find the right glibc. You are using 64bit right? Because in 64Bit every library is in /*/lib64 So /usr/lib/libc.so is the 32Bit library. But I can't think of anything to solve this.

6th January 2007, 10:16 AM
I guessed so too - but i have glibc already, and that doesnt solve my problem. :-(

6th January 2007, 10:40 AM
try installing glibc-devel

6th January 2007, 12:14 PM
I had installed glibc-devel too -- even that didn help. Is there some other idea?

6th January 2007, 12:22 PM
try this link ( the output is similar )


I'm still having problems. I took your advice and separately compile
the esqlC code and the unixODBC code. Wheh I attempt to link,I get an
error - see below.

[kcj@kylie examples]$ esql -o program cus.o main_kcj.o
-L/usr/local/easysoft/un ixODBC/lib -L/usr/local/easysoft/oob/client
/usr/bin/ld: skipping incompatible
/usr/local/easysoft/unixODBC/lib/libodbc.so when searching for -lodbc
/usr/bin/ld: cannot find -lodbc
collect2: ld returned 1 exit status

6th January 2007, 07:24 PM
can u please explain what that means? i've tried doing something similar but it's not working still. Thanx anyway!

6th January 2007, 07:38 PM
did you Install the 32 bit versions of glibc & glibc-devel as well