This is the mail archive of the gcc-help@gcc.gnu.org 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]
Other format: [Raw text]

RE: Simple linking problem


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


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