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

Re: static libs



>>>>> "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.*

-- 
Stephen
---
It should be illegal to yell "Y2K" in a crowded economy.  :-) -- Larry Wall


Reply to: