#include <FakeMas.h>
#include <zinc-testsupport-client-api/ClientFactory.h>
#include <zinc-testsupport-client-api/Process.h>
#include <zinc-testsupport-client-api/ProcessCreator.h>
FakeMas::FakeMas() {
ClientFactory &clientFactory(PluginFactory::getInstance<ClientFactory>(pluginConfig));
boost::shared_ptr<ProcessCreator> webServerProcessCreator = clientFactory.createProcessCreator();
}
当我构建它时,我收到一条错误消息:
...../src/.libs/libZincTestWebServer.so: undefined reference to `zinc::testsupport::client::ClientFactory::createProcessCreator()'
有趣的是,如果我注释掉课程的第二行
boost::shared_ptr<ProcessCreator> webServerProcessCreator = clientFactory.createProcessCreator()
然后它将建立成功
所以我感到困惑,似乎没有链接问题,因为它可以构建
ClientFactory &clientFactory(PluginFactory::getInstance<ClientFactory>(pluginConfig))
那么它如何找到类但找不到功能?
顺便说一句,我认为该函数是以正确的方式声明和定义的:
boost::shared_ptr<ProcessCreator> ClientFactory::createProcessCreator() {
.........
}
有人知道吗?谢谢