Hey everybody again, I'm using --allow-shlib-undefined to achieve this. Does anybody knows what kind of headaches I may face in future when using this!? Bye! 2016-08-16 11:14 GMT-03:00 Daniel. <danielhilst@xxxxxxxxx>: > Hi everybody! > > Suppose that I have 3 shared files, > and two target machines M1 and M2. > > libA.so, libB.so and libC.so. > > libB.so is linked against libA.so only when compiled > to M1, but not in M2. > > libC.so is aways linked against libB.so > > So we have: > > M1: libA.so <- libB.so <- libC.so <- executable. > M2: libB.so <- libC.so <-executable > > I want to hide libA.so need while linking libB, > so that libC has not to pass -lA to linker depending > on machine. And to > hide libB and libA while linking to libC, so that > the user need to pass only -lC. Is that possible? > > For example, linking in M1 would be: > cc -fPIC -shared -o libA.so libA.c > cc -fPIC -shared -o libB.so libB.c -lA > cc -fPIC -shared -o libC.so libC.c -lB (no need to -lA is the point here) > cc -o executable executable.c -lC (no need to -lB -lA is the point here) > > And for M2 would be: > cc -fPIC -shared -o libB.so libB.c > cc -fPIC -shared -o libC.so -lB > cc -o executable executable.c -lC > > In both cases (machines) the compilation of executable and libC > is done by the same command line. > > > Cheers, > > > -- > "Do or do not. There is no try" > Yoda Master -- "Do or do not. There is no try" Yoda Master -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html