Hi folks,
I'm having trouble compiling a project of mine and I'm not sure exactly where the problem lies. I suspect I haven't enabled/disabled something in the C::B IDE, but am at a complete loss as to exactly what that might be. Apologies for the slightly complicated title, but my problem is slightly complicated...
My situation is that I'm writing a shared library (say, library A) that links to another shared library (library B). I've got these two library projects and a MainApp project in a single workspace, with project dependencies: MainApp depends on library A, library A depends on library B. Both libraries build ok and in any order (i.e. library B builds ok on it's own, and library A also builds ok after building library B), but when I try to build MainApp I am hit with undefined reference errors on library A.
I have placed the reference to library B in the Link Settings -> Link Libraries for library A, and similarly the reference to library A for MainApp. I expected library A to implicitly use library B because of its link settings, but (on reading a post online:
http://gcc.gnu.org/ml/gcc-help/2008-07/msg00266.html) when running "ldd" on the library A file to list the dependencies, I don't see library B listed.
Build log for library B (Images):
g++ -shared -L/home/richard/programming/wxWidgets-2.9.4/mybuild/lib obj/Debug/src/StatusGridCellRendererBitmaps.o obj/Debug/src/ItemsPanelBitmaps.o -o bin/Debug/libImages.so -L/usr/local/lib -pthread -lwx_gtk2u-2.9
Build log for library A (RunSamplesWorkspace):
g++ -shared -L../Images/bin/Debug -L/home/richard/programming/wxWidgets-2.9.4/mybuild/lib obj/Debug/src/TableArrangement.o obj/Debug/src/StatusGridCellRenderer.o obj/Debug/src/ItemExecutable.o obj/Debug/src/ItemsPanel.o obj/Debug/src/RunlistPanel.o -o bin/Debug/libRunSamplesWorkspace.so -L/usr/local/lib -pthread -lwx_gtk2u-2.9 -lImages
Build log for MainApp (MainApp):
g++ -L../RunSamplesWorkspace/bin/Debug -L/home/richard/programming/wxWidgets-2.9.4/mybuild/lib -o bin/Debug/MainApp obj/Debug/src/App.o -L/usr/local/lib -pthread -lwx_gtk2u-2.9 -lRunSamplesWorkspace
../RunSamplesWorkspace/bin/Debug/libRunSamplesWorkspace.so: undefined reference to `RunSamples::GetDeleteBitmap()'
(message repeated for all namespace functions included, but are all defined in the library B implementation files)
Please help. What have I missed or done wrong? Any and all advice is most welcome, and please request any extra information as you need. Or, indeed, if this is the wrong forum to ask this question (is it compiler/linker related?), then please forgive me but please tell me so I can go to their forums and try again.
Thanks in advance.
Richard ~
Ubuntu 12.10, Code::Blocks svn (pasgui, precise package), gcc 4.7.2