我在Visual Studio 10中编译了一个由我自己开发的库,它使用Boost 1.55.0和第三方库,但是在链接阶段我得到了以下错误。
第三方库开发人员告诉我使用标志wchar_t-重新编译所有代码(我的代码和Boost;第三方作为二进制文件提供),以避免将wchar_t
视为Visual Studio中的类型。第三方库开发人员向我保证用这个开关编译它的第三方库,并建议我重新编译所有剩余的代码(即。,我的代码和Boost)。
我已经这样做了,但错误仍然存在。
我还想说在启用交换机之前wchar_t-所有工作(编译和链接)都很好;引入第三方图书馆时出现的问题。
Generating Code...
create_helper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::~basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(void)" (__imp_??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@XZ) referenced in function "int class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __cdecl cea::ifc::get_type(class ifc4::IfcMaterial *)'::1'::dtor$1" (?dtor$1@?0??get_type@ifc@cea@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PEAVIfcMaterial@ifc4@@@Z@4HA)
create_helper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &&)" (__imp_??0?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@$$QEAV01@@Z) referenced in function "class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > __cdecl cea::ifc::get_type(class ifc4::IfcMaterial *)" (?get_type@ifc@cea@@YA?AV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@PEAVIfcMaterial@ifc4@@@Z)
create_helper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Step::String::String(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (__imp_??0String@Step@@QEAA@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function "void __cdecl cea::ifc::set_type(class ifc4::IfcMaterial *,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (?set_type@ifc@cea@@YAXPEAVIfcMaterial@ifc4@@AEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)
create_helper.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >::compare(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)const " (__imp_?compare@?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAHAEBV12@@Z) referenced in function "bool __cdecl std::operator==<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (??$?8GU?$char_traits@G@std@@V?$allocator@G@1@@std@@YA_NAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@0@Z)
C:\Users\DM241428\Documents\Visual Studio 2010\Projects\cpp-ifc-model\x64\Debug\cpp-ifc-model.dll : fatal error LNK1120: 4 unresolved externals