错误LNK2001:在构建用于插件的DLL文件时

时间:2019-05-22 13:11:05

标签: c++ dll poco poco-libraries

我试图借助poco c ++库构建一个类加载器。我正在关注此资源https://pocoproject.org/slides/120-SharedLibraries.pdf。 我试图将插件支持添加到使用poco 1.5.3的开源项目中。 即使在为插件加载程序构建dll文件时,它也会给出链接错误,但是当我关闭整个程序优化选项时,所有错误都会得到解决。直到这里poco 1.5.3都可以工作,但是在构建类加载器时却给出了未解决的外部符号链接错误。但是,当我在Linker-> input部分中将链接库的路径更改为poco 1.9时,它可以正常工作。但是由于依赖性问题,我想坚持使用poco 1.5.3。

我在StackOverflow中遵循了一些答案,该答案告诉您在项目的.lib中添加Linker->input或添加其他依赖项目录,但这没有用。还有著名的答案What is an undefined reference/unresolved external symbol error and how do I fix it?,但对我来说似乎有点不同。 我在pdf的末尾关注main.cpp for classloader程序。

错误消息如下:

  

Pluginloader.obj:错误LNK2001:无法解析的外部符号“ __declspec(dllimport)公共:静态无效__cdecl Poco :: Bugcheck :: nullPointer(char const *,char const *,int)”(__imp_?nullPointer @ Bugcheck @ Poco @@ SAXPEBD0H @ Z)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:__ cdecl Poco :: FastMutex :: FastMutex(void)”(__ imp _ ?? 0FastMutex @ Poco @@ QEAA @ XZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:__ cdecl Poco :: FastMutex ::〜FastMutex(void)”(__ imp _ ?? 1FastMutex @ Poco @@ QEAA @ XZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:void __cdecl Poco :: FastMutex :: lock(void)”(__ imp_?lock @ FastMutex @ Poco @@ QEAAXXZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:void __cdecl Poco :: FastMutex :: unlock(void)”(__ imp_?unlock @ FastMutex @ Poco @@ QEAAXXZ)   1> Pluginloader.obj:错误LNK2001:无法解析的外部符号“ __declspec(dllimport)public:__cdecl Poco :: ManifestBase :: ManifestBase(void)”(__imp _ ?? 0ManifestBase @ Poco @@ QEAA @ XZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:虚拟__cdecl Poco :: ManifestBase ::〜ManifestBase(void)”(__ imp _ ?? 1ManifestBase @ Poco @@ UEAA @ XZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:__ cdecl Poco :: SharedLibrary :: SharedLibrary(class std :: basic_string,class std :: allocator> const&)”(__imp _ ?? 0SharedLibrary @ Poco @@ QEAA @ AEBV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@@ Z)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:虚拟__cdecl Poco :: SharedLibrary ::〜SharedLibrary(void)”(__ imp _ ?? 1SharedLibrary @ Poco @@ UEAA @ XZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:void __cdecl Poco :: SharedLibrary :: unload(void)”(__ imp_?unload @ SharedLibrary @ Poco @@ QEAAXXZ)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:bool __cdecl Poco :: SharedLibrary :: hasSymbol(class std :: basic_string,class std :: allocator> const&)”(__imp_?hasSymbol @ SharedLibrary @ Poco @@ QEAA_NAEBV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@@ Z)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)public:void * __cdecl Poco :: SharedLibrary :: getSymbol(class std :: basic_string,class std :: allocator> const&)”(__imp_?getSymbol @ SharedLibrary @ Poco @@ QEAAPEAXAEBV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@@@ Z)   1> Pluginloader.obj:错误LNK2001:未解析的外部符号“ __declspec(dllimport)公共:静态类std :: basic_string,类std :: allocator> __cdecl Poco :: SharedLibrary :: suffix(void)”(__imp_?suffix @ SharedLibrary @ Poco @@ SA?AV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@ XZ)   1> C:\ Users \ Debashish \ documents \ Visual Studio 2015 \ Projects \ Pluginloader \ x64 \ Release \ Pluginloader.exe:致命错误LNK1120:13个未解决的外部组件

请帮助我为插件构建dll

0 个答案:

没有答案