PDA

View Full Version : gcc compilation problems


digjam
6th January 2007, 05: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]
ThanQ!
DigJaM

Noneus
6th January 2007, 08: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.

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

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

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

leigh123linux
6th January 2007, 11:22 AM
try this link ( the output is similar )

http://www.dbtalk.net/comp-databases-informix/esql-library-header-files-compile-316772.html

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
-lodbc
/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

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

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

Bangladesh - Dogondoutchi Instagram Photos - Energeticheskiy Photos