I have 3 projects A, B and C.
A is universal and used by B and eventually C.
B is a bit more special and up to now only used by C.
Now as I want A and B to be reused as much as possible I thought of both being static libraries.
So I link A and B to static libraries and C to an executable, but when I want to link C
it gives me some undefined reference errors on A functions. So I added the library A to the linker options to resolve this but it did not help.
So I thought: when I want to deploy B then I also will have to deploy A to be able to link. Is there a way to link the static library A into static library B so I do not have to deploy 2 files?
And if so, how do I achieve this with Eclipse CDT, because I cant find a place where to define additional targets for the archiver.
Addition
I am working under linux but the things should also work under windows. But mainly I need a solution for linux to keep going with the development.
EDIT
Right now I “solved” the problem by linking A and B into static libraries and then use the remaining *.o files to link them into the executable but I do not consider this as good.
a static library cannot be linked with another static library. I think because a static library is not an executable code and so full linking process (mainly references resolution) is not done. It’s done only for dynamic libraries and executables.