This is the mail archive of the
crossgcc@cygnus.com
mailing list for the crossgcc project.
NT->Linux Cross egcs: ld: cannot open -lc
- To: "Crossgcc" <crossgcc@cygnus.com>
- Subject: NT->Linux Cross egcs: ld: cannot open -lc
- From: "Kevin Farrell" <kfarrell@seagull.nl>
- Date: Thu, 8 Jul 1999 14:29:57 +0100
- Reply-To: crossgcc@cygnus.com
Hi,
First of all, thanks to those people who helped me out with my efforts at
building a (cyg)Win->Linux Candian cross egcs. At last, I have successfully
compiled both the egcs-1.1.2 sources and the binutils-2.9.1 sources using
the Cygwin b20.1 sources which I compiled to target Win32 but run on my
Linux machine (SuSE 6.1) .
However I still have some problems:
(1) Using a simple hello.cpp test file I am able to produce an object file
with the compiler -c option; (i.e. i586-linux-gnu-gcc -c hello.cpp) However,
when I try to produce an executable I get the following error:
-----
/butils/bin/i586-linux-gnu-ld: cannot open -lc: No such file or directory
collect2: ld returned 1 exit status
-----
(2) When I copy the hello.o to my Linux box and try to link it with: ld -o
output /usr/lib/crt1.o hello.o -lc
I get the following undefined reference errors; for example:
-----
hello.o: In function `main':
hello.o(.text+0x4): undefined reference to `endl(ostream &)'
hello.o(.text+0xe): undefined reference to `cout'
hello.o(.text+0x13): undefined reference to `ostream::operator<<(char const
*)'
hello.o(.text+0x1e): undefined reference to `ostream::operator<<(ostream
&(*)(ostream &))'
-----
Presumably, the cause of this is the linker not finding the relevant
libraries, and not a problem with the compiled object code???
My set up is as follows:
The directory /butils is the location of the binutils products. I downloaded
glibc-2.0.bin.i386.tgz and utarred that into my root (C:) directory, so I
have C:\usr. I also copied the /usr/include/linux and /usr/include/asm
directories from my Linux machine to C:\usr\include\linux and
C:\usr\include\asm respectively. Am I right to use the glibc-2.0.bin.i386?
Do I need something else in addition to these?
Any help would be greatly appreciated,
Thanks,
Kevin.
Kevin Farrell
Software Developer
<mailto: kfarrell@seagull.nl>
SEAGULL IRELAND
Swords Business Plaza, Main street, Swords, Co. Dublin, Ireland
P.O.Box 6751, Swords.
Tel. +353 1 8903090, Fax +353 1 8903089
http://www.seagullsw.com/
winmail.dat