The order matters for most linkers!
g++ -L../RunSamplesWorkspace/bin/Debug -L../Images/bin/Debug -o bin/Debug/MainApp obj/Debug/src/App.o -L/usr/local/lib -pthread -lwx_gtk2u-2.9 -lImages -lRunSamplesWorkspace
../RunSamplesWorkspace/bin/Debug/libRunSamplesWorkspace.so: undefined reference to `RunSamples::GetDeleteBitmap()'
(etc)
Try to always paste the library you are adding at the end or the beginning if it still has the linking error.
In this case, the end is needed for GCC/g++.
So, move "-lImages" after "-lRunSamplesWorkspace"
Edit2: In code::blocks this means move the library down the list so "Images" is at the bottom.
I suggest adding all new libraries at the bottom of the list till you find a better way.
Tim S.
Thanks for the linking advice, but I don't mean to be stubborn here but MainApp doesn't use anything from library B, just library A, so shouldn't library A list B when tying ldd libraryA. This is why I wonder about the linking when building library A (RunSamplesWorkspace).
I tried swapping the order as you suggested anyway, but, as with my previous attempts, it's made no difference.
g++ -L../RunSamplesWorkspace/bin/Debug -L../Images/bin/Debug -o bin/Debug/MainApp obj/Debug/src/App.o -L/usr/local/lib -pthread -lwx_gtk2u-2.9 -lRunSamplesWorkspace -lImages
../RunSamplesWorkspace/bin/Debug/libRunSamplesWorkspace.so: undefined reference to `RunSamples::GetDeleteBitmap()'
(etc)
Again, I really don't mean to be stubborn or rude here; I really do appreciate your feedback and comments. I'm just trying to understand where my problem lies. It's good to know that I've been handling Code::Blocks correctly (mostly) when trying to write for and with custom shared libraries.
Thanks,
Richard ~