【发布时间】:2014-04-07 21:36:58
【问题描述】:
我在使用 Boost 和我的 Mac OS X 时遇到问题。
我使用 Qt Creator 作为 C++ 项目的开发平台,主要是因为 IDE 和qmake。
现在我正在开发一个应该是跨平台的 C++ 应用程序,但我不想使用 Qt 框架本身。相反,我使用的是 STD 库 (C++11)、Poco 和 Boost。
我想要实现的一件事是在运行时加载动态链接库的插件系统。
我看到了一些项目,例如 Boost-extension,它们不再受支持,还有几个其他项目。
现在我正在使用Poco's Shared Libraries 和他们的Class Loader。我正在密切关注演示结束时的教程。不幸的是,我无法让它工作,并且在编译时收到以下错误,ServiceBase 类是我的插件接口。
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
我已经链接了 Poco 库,并且几乎所有内容似乎都已实现。
关于如何解决这个问题的任何建议?
附:我也在寻找实现插件系统的替代方案,可能更强大并且肯定是跨平台的。
【问题讨论】:
标签: c++ dll runtime poco qmake