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: newbie question: building and using a static lib


Hi Dieter,

The command line is order sensitive.

You have the order backwards.

Put your .o files before the -l<lib> files.  Otherwise, the linker says*
"Here I have libmyclass.lib, what missing symbols do I need out of there?
Hey, I don't have any missing symbols at the moment, I don't need to
incorporate anything from libmyclass.lib."

Also, you don't need the -I<dir> for doing the linking operation.  Doesn't
hurt, either.  Just clutter.

HTH,
--Eljay

* Don't anthropomorphize linkers.  They hate it when you do that.


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