| Paulo Matos 2006-05-12, 7:15 am |
| Hi all,
I'm developing a software which after some versions, I've decided to
divide it into separate components (modules / shared libs). So I came
to a structure as follows:
tree
|- lib1
|- lib2
|- core
Problem is that lib1 and lib2 need some data structures also used by
core. Without doing code duplication I see two hypothesis which seem to
have a problem.
I can put the data structures into a lib3 and then link lib1, lib2 and
core to lib3 or I can create a common directory and put there all the
code used by lib1, lib2, core and compile everything with those files.
The problem is that when linking core with lib1 and lib2 I'll probably
get duplicate identifiers because I compile core with those files and
link to lib1 but lib1 was in turn already compiled with those files.
Any ideas/suggestions?
Thanks,
Paulo Matos
|