Quantcast

static lib APIs on *nix; building w/ make/g++

$tinkle

Expert on blowing
Feb 12, 2003
14,591
6
so we have this in-house tool that's advertised as pnp - no make'ing required. however, when building downstream dependencies, the main api can be seen, but embedded calls to other routines, or references to external consts aren't.

i'm led to believe our make file should just cp junk over to some pre-determined libdir, and all's well. but, downstream schit blows up, claiming the main api can't see calls ("in source file foo.c, undefined reference to 'foo2' "). i've even tried cp'ing the other 1/2 dozen libs into the libdir.

i'm more of a new school dynamic lib cat, so how .a's talk to ea other is a little muddy for me. all i know is they're finicky in that you change one dependency, you gotta rebuild the world.

w.
t.
f.?
 

$tinkle

Expert on blowing
Feb 12, 2003
14,591
6
ok, looks like i need to also cp dependent (to the new API) libs into the libdir, as it's possible for static libs to [correctly] have unresolved externals. also, the references to these libs in makefiles (w/ "-Xlinker -Bstatic") must be made in the same build order in other apps which refer to the parent API