Search code examples
c++visual-studioassimp

unresolved external symbol in visual studio while using assimp library


i have built assimp library and create .lib file, now I am using that into sample application but when i try to build sample app, i get errors:

1>assimp.lib(FBXParser.obj) : error LNK2001: unresolved external symbol _inflate
1>assimp.lib(BlenderLoader.obj) : error LNK2019: unresolved external symbol _inflate referenced in function "protected: virtual void __thiscall Assimp::BlenderImporter::InternReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct aiScene *,class Assimp::IOSystem *)" (?InternReadFile@BlenderImporter@Assimp@@MAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAUaiScene@@PAVIOSystem@2@@Z)
1>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflate
1>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflate
1>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflate
1>assimp.lib(FBXParser.obj) : error LNK2001: unresolved external symbol _inflateEnd
1>assimp.lib(BlenderLoader.obj) : error LNK2019: unresolved external symbol _inflateEnd referenced in function "protected: virtual void __thiscall Assimp::BlenderImporter::InternReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct aiScene *,class Assimp::IOSystem *)" (?InternReadFile@BlenderImporter@Assimp@@MAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAUaiScene@@PAVIOSystem@2@@Z)
1>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflateEnd
1>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateEnd
1>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflateEnd
1>assimp.lib(BlenderLoader.obj) : error LNK2019: unresolved external symbol _inflateInit2_ referenced in function "protected: virtual void __thiscall Assimp::BlenderImporter::InternReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct aiScene *,class Assimp::IOSystem *)" (?InternReadFile@BlenderImporter@Assimp@@MAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAUaiScene@@PAVIOSystem@2@@Z)
1>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflateInit2_
1>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateInit2_
1>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflateInit2_
1>assimp.lib(AssbinLoader.obj) : error LNK2019: unresolved external symbol _uncompress referenced in function "public: virtual void __thiscall Assimp::AssbinImporter::InternReadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct aiScene *,class Assimp::IOSystem *)" (?InternReadFile@AssbinImporter@Assimp@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAUaiScene@@PAVIOSystem@2@@Z)
1>assimp.lib(XFileParser.obj) : error LNK2019: unresolved external symbol _inflateSetDictionary referenced in function "public: __thiscall Assimp::XFileParser::XFileParser(class std::vector<char,class std::allocator<char> > const &)" (??0XFileParser@Assimp@@QAE@ABV?$vector@DV?$allocator@D@std@@@std@@@Z)
1>assimp.lib(XFileParser.obj) : error LNK2019: unresolved external symbol _inflateReset referenced in function "public: __thiscall Assimp::XFileParser::XFileParser(class std::vector<char,class std::allocator<char> > const &)" (??0XFileParser@Assimp@@QAE@ABV?$vector@DV?$allocator@D@std@@@std@@@Z)
1>assimp.lib(unzip.obj) : error LNK2019: unresolved external symbol _crc32 referenced in function _unzReadCurrentFile
1>assimp.lib(unzip.obj) : error LNK2019: unresolved external symbol _get_crc_table referenced in function _unzOpenCurrentFile3
1>assimp.lib(FBXParser.obj) : error LNK2019: unresolved external symbol _inflateInit_ referenced in function "void __cdecl Assimp::FBX::`anonymous namespace'::ReadBinaryDataArray(char,unsigned int,char const * &,char const *,class std::vector<char,class std::allocator<char> > &,class Assimp::FBX::Element const &)" (?ReadBinaryDataArray@?A0x110075d1@FBX@Assimp@@YAXDIAAPBDPBDAAV?$vector@DV?$allocator@D@std@@@std@@ABVElement@23@@Z)

Solution

  • from what I read there (http://assimp.sourceforge.net/main_features.html), the library depends on zlib.

    My guess is that you're not linking zlib.lib to your project, or zlib is not properly compiled with assimp, that would explain why the _inflate method is missing.