提升wserialization和链接问题

时间:2017-04-11 15:16:09

标签: c++ boost linker

我正在尝试在Visual Studio 2017中构建.exe,并不断收到链接错误消息(LNK 2001),实际上有18个,包括Debug或Release,x86或x64。

我正在使用预建二进制下载中的Boost_1_63_msvc14。

我已阅读Microsoft-msdn网站上的LNK 2001页面和Boost参考。无论如何,通过狭窄的字符,它可以完美地工作。序列化和 w 序列化库都存在。

编译和链接的设置如下:

  • 编译器使用“属性 - > C / C ++ - >一般 - >其他包含指令 - >(Boost目录)”
  • 链接器带有“Properties - > Linker - > General - > Additional Library Directories - >(The Boost dir / lib64-msvc-14.0)”和“Properties - > Linker - > Input - &gt ;其他依赖关系 - >(图书馆本身)“
  • “属性 - > C / C ++ - >所有选项 - >将WChar_t视为内置类型 - >是(/ Zc:wchar_t)”
  • “属性 - > C / C ++ - >所有选项 - >调用约定 - > __cdecl(/ Gd)”

使用窄序列化,我不需要指定Linker-Input-> ...所以我也试过了,但没有这样做。

我包含了任何有用的库:

#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/archive/basic_binary_iarchive.hpp>
#include <boost/archive/basic_binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_wiarchive.hpp>
#include <boost/archive/binary_woarchive.hpp>
#include <boost/archive/basic_binary_iprimitive.hpp>
#include <boost/archive/basic_binary_oprimitive.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/deque.hpp>

链接器的错误示例:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol "protected: void __cdecl boost::archive::basic_binary_oarchive<class boost::archive::binary_woarchive>::init(void)" (?init@?$basic_binary_oarchive@Vbinary_woarchive@archive@boost@@@archive@boost@@IEAAXXZ) prog1   C:\Users\User\Documents\Visual Studio 2017\Projects\prog1_SOLU\prog1\func.obj   1   

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2001 unresolved external symbol "protected: __cdecl boost::archive::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >::basic_binary_oprimitive<class boost::archive::binary_woarchive,wchar_t,struct std::char_traits<wchar_t> >(class std::basic_streambuf<wchar_t,struct std::char_traits<wchar_t> > &,bool)" (??0?$basic_binary_oprimitive@Vbinary_woarchive@archive@boost@@_WU?$char_traits@_W@std@@@archive@boost@@IEAA@AEAV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@_N@Z)  prog1   C:\Users\User\Documents\Visual Studio 2017\Projects\prog1_SOLU\prog1\func.obj   1   

我错了什么?

0 个答案:

没有答案