This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Simple linking problem
- From: "John \(Eljay\) Love-Jensen" <eljay at adobe dot com>
- To: "gccNewbie" <bguild at shaw dot ca>, <gcc-help at gcc dot gnu dot org>
- Date: Thu, 10 May 2007 04:39:58 -0700
- Subject: RE: Simple linking problem
- References: <10411665.post@talk.nabble.com>
Hi gccNewbie,
>So it is really a very simple riddle. 'gcc -lmylib mysource.c' uses a function 'foo' which nm shows is defined in libmylib.a. gcc does not complain about not being able to find mylib, but it does complain that 'foo' is an 'undefined reference'. In what situation could that happen?
Dependency order is important.
What happens when you do:
gcc mysource.c -lmylib
HTH,
--Eljay