I have 3 code "chunks" for my project: 2 static libraries: LibraryA and LibraryB, and a console application: Client.
The client calls LibraryA and LibraryA calls LibraryB. The client does NOT use LibraryB at all.
Right now, I have Library A compiled just fine but when I try to compile the client I get an error because it cannot locate LibraryB. Here is what the Build Log says leading upt to the error:
g++ -L/path/to/LibraryA -L/path/to/LibraryB/ -o bin/Debug/Client obj/Debug/main.o LibraryA.a "LibraryB.a"
LibraryA.a(LibraryA.o): In function `LibraryA_Class::function(args)':
LibraryA.cpp:136: undefined reference to `namespace::LibraryB::LibraryB_class()'
I'm not sure what the issue is, any help is appreciated. I'm using Code::Blocks 13.12 in Ubuntu 14.04 (VirtualBox) with the GNU GCC Compiler
Thanks in advance. Let me know if more information is needed.
Update
I modified the settings to take out the -L commands at the beginning so now it looks like this (with the actual library names):
g++ -o bin/Debug/Client obj/Debug/main.o ../../Wrapper/FCS_PlanTrajectory/bin/Debug/libFCS_PlanTrajectory.a ../../BAE/lib_obj/libCMetInterpIf.a
../../Wrapper/FCS_PlanTrajectory/bin/Debug/libFCS_PlanTrajectory.a(PlanTrajectory.o): In function `PlanTrajectory_Class::planSingleTrajectory(unsigned char, Position_T const&, double, double*, Position_T const&, unsigned char, std::vector<agsfirecontrol::METOCGridPoint_T, std::allocator<agsfirecontrol::METOCGridPoint_T> > const&, unsigned char, double, double, double*, Position_T*, double&, double&, unsigned int&, agsfirecontrol::AgsFireControlCompliance_T&)':
/home/angela/Work/FCS/Code/Wrapper/FCS_PlanTrajectory/src/PlanTrajectory.cpp:136: undefined reference to `agsfirecontrol::CMetInterpIf::CMetInterpIf()'
/home/angela/Work/FCS/Code/Wrapper/FCS_PlanTrajectory/src/PlanTrajectory.cpp:193: undefined reference to `agsfirecontrol::CMetInterpIf::~CMetInterpIf()'
/home/angela/Work/FCS/Code/Wrapper/FCS_PlanTrajectory/src/PlanTrajectory.cpp:193: undefined reference to `agsfirecontrol::CMetInterpIf::~CMetInterpIf()'
LibraryA = PlanTrajectory, LibraryB = CMetInterpIf
The second 2 errors have always been present also if that helps at all. Btw, I'm using relative paths because eventually I need this to be portable to another machine. I can change to absolute paths if it will help anything
nm -C libCMetInterpIf.a | fgrep 'agsfirecontrol::CMetInterpIf::CMetInterpIf()'
nm: CEnvironment.o: no symbols
nm: CMetInterpIf.o: no symbols
nm: CMathUtilities.o: no symbols