[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: static libs

Stephen Zander wrote:
> >>>>> "Ionutz" == Ionutz Borcoman <borco@borco-ei.eng.hokudai.ac.jp> writes:
>     Ionutz> The proble is that sometime, when linking witht these .a
>     Ionutz> libs, I get unresolved symbols for some of the functions
>     Ionutz> from xxx.a call by functions from yyy.a. And this is only
>     Ionutz> sometime, aka for some of my programs (strange) and even
>     Ionutz> that i link with both xxx.a and yyy.a (also strange, at
>     Ionutz> least for me).
> If yyy.a has code that depends on xxx.a, put it first in the library
> list.  If xxx.a has code that also depends on yyy.a, include yyy.a
> before and after xxx.a or include xxx.a before and after yyy.a.
> None of this necessary when using shared libraries, 'cause they only
> have one, global symbol table.  static libs have a symbol table in
> each object file they include, but these tables are only read *at the
> time the library is first encoutered, and the objects are only
> included if they have to be.*

Thanks a lot. This was what I was looking for. I have had try before
putting libvdk.a in from or after libvdkcompo.a (libvdkcompo.a dependes
on libvdk.a). Never thought to put libvdk.a if front AND after
libvdkcompo.a. Now the program compiles with the static libs also. 


Reply to: