User forums > Using Code::Blocks
undefined reference to shared library from shared library
MyMindsAvatar:
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.
--- Code: ---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)
--- End code ---
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 ~
stahta01:
I think it is time to post your question in another forum.
I am only a C programmer; it is possible this is a C++ linking issue I am not familiar with.
Here a site that is good. http://cboard.cprogramming.com/cplusplus-programming/
Without the code it is hard to do much more; and even with the code I am unlikely to help very much.
Tim S.
MyMindsAvatar:
Much obliged for your help and pointers. I have posted already on StackOverflow (http://stackoverflow.com/questions/13546812/ldd-doesnt-show-custom-shared-library-after-building) and will await responses there (will probably try your suggestion as well, no harm I'm sure). I'm under no time constraint so can afford the time here, it's just very annoying at this stage (I have alternatives to using libs-linked-to-libs, but I'd rather use them if I can for other reasons).
Many thanks again,
Richard ~
Edit: FOUND IT! Though I don't understand it.
I had declared a small collection of functions in a namespace in the header files. I tried removing the functions from the namespace and voila. My question then turns into a "Why does this not work with functions in a namespace?" but that is most definitely not in the realms of this forum. Again, my thanks for your support.
Navigation
[0] Message Index
[*] Previous page
Go to full version