This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: newbie question: building and using a static lib - THANKS !!
- From: Dieter Tschermernig <d dot tschermernig at efkon dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 06 Mar 2006 16:14:47 +0100
- Subject: Re: newbie question: building and using a static lib - THANKS !!
- References: <C031A9DD.AF89%eljay@adobe.com>
John, you're the man !!
It was the sequence of course. As mentioned, I had tried to shuffle the
order of the libraries around... but for whatever reason (spuidness ?)
it didn´t occur to me that I have to mention the .o before the
libraries, since it relies to the functions in the librarues..... ARRGH.
Maybe I should look into gardening or something :)
Anyway, thanks so much for the help !
(Of course also to you, Leopold.)
regards,
Dieter
John Love-Jensen wrote:
> 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.