I am having trouble with Boost and my Mac OS X.
I am using Qt Creator as a development platform for C++ projects, primarily because of the IDE and qmake
.
Right now I am working on a C++ app that is supposed to be cross-platform but I do not want to use the Qt
framework itself. Instead I am using the STD libraries (C++11) , Poco
and Boost
.
One of the things I am trying to achieve is a plugin system that loads dynamically linked libraries at runtime.
I saw a few projects like Boost-extension
which is no longer supported and several others.
Right now I am using Poco's Shared Libraries and their Class Loader
. I am following closely the tutorial at the end of the presentation. Unfortunately I cannot get it working and I am receiving the following error upon compilation, where the ServiceBase
class is my plugin interface.
Undefined symbols for architecture x86_64:
"Poco::SharedLibrary::getSymbol(std::string const&)", referenced from:
Poco::ClassLoader<ServiceBase>::loadLibrary(std::string const&, std::string const&) in main.o
"Poco::SharedLibrary::hasSymbol(std::string const&)", referenced from:
Poco::ClassLoader<ServiceBase>::loadLibrary(std::string const&, std::string const&) in main.o
"Poco::SharedLibrary::SharedLibrary(std::string const&)", referenced from:
Poco::ClassLoader<ServiceBase>::loadLibrary(std::string const&, std::string const&) in main.o
"Poco::SystemException::SystemException(std::string const&, int)", referenced from:
Poco::MutexImpl::unlockImpl() in main.o
Poco::MutexImpl::lockImpl() in main.o
"Poco::LibraryLoadException::LibraryLoadException(std::string const&, std::string const&, int)", referenced from:
Poco::ClassLoader<ServiceBase>::loadLibrary(std::string const&, std::string const&) in main.o
ld: symbol(s) not found for architecture x86_64
I have the Poco libraries linked and pretty much everything seems to be implemented.
Any advice on how to fix that?
PS I am also looking for alternatives on implementing the plugin system, probably more-powerful and certainly cross-platform.
Disclaimer. I have no experience with this Poco library.
Without further details on your environment or your tools... I can only provide some very general advice:
How I'd chase this is:
I know you said you have linked the Poco libraries, but the error is clearly that a symbol is missing. Either the library is missing or you need to fiddle with the order of the -l flags to satisfy the dependencies. The nm might help you there in determining what objects or libraries refer to the symbol (must come first) and what objects or libraries define the symbol (must come later).
Sorry not being of more help.
PS In addition you might want to look at Linking error with Poco Net which might be related.
One more reference to a question that details different causes for linker errors: What is an undefined reference/unresolved external symbol error and how do I fix it?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.