gcc/g++/ld caching? -
i'm developing program generates parts of c/c++ libraries. e.g. creates directories - lib1, lib2, .. , libn. each library generates c/c++ code + makefile, uses gcc/g++ + ld , calls code libraries. problem if lib1 has function fun
, libn well, when calling fun
libn, lib1 used. i've tried different versions of gcc/g++ v4.7.
now problem if lib1 has function fun , libn well, when calling fun libn, lib1 used.
presumably talking shared libraries, , not archive libraries (where you'd multiply-defined symbol error).
yes, how supposed work, , has always worked on unix. caching has nothing it.
if on elf platform, might able make work more windows-like using -wl,-bsymbolic
, you'll fighting default system behavior, , should expect rough ride, , lots of unexpected gotcha's. if fun
doesn't need exposed libx
, hidden symbol visibility friend.
since generating code lib1
, ... libn
, might easier avoid name collision using e.g. libx_fun
instead of fun
. more portable, work everywhere.
update:
function name has fun according interface specifications.
according who's interface specifications?
you control both main program, , libraries. can, , should change interface specification avoid problem.
Comments
Post a Comment