Assimp, zlib, and LNK2001 errors

Started by
0 comments, last by Rectangle 11 years, 7 months ago
Using MSVC 2010 I have set both zlib and assimp to static libs, which use the Multi-threaded DLL (/MD) option, as to avoid any extra DLL dependency issues. They both compile without error or warning. But when I try to link my project against assimp.lib, I get the following output:
[source lang="cpp"]2>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflateEnd
2>assimp.lib(BlenderLoader.obj) : error LNK2001: unresolved external symbol _inflateEnd
2>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflateEnd
2>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateEnd
2>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflate
2>assimp.lib(BlenderLoader.obj) : error LNK2001: unresolved external symbol _inflate
2>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflate
2>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflate
2>assimp.lib(XGLLoader.obj) : error LNK2001: unresolved external symbol _inflateInit2_
2>assimp.lib(BlenderLoader.obj) : error LNK2001: unresolved external symbol _inflateInit2_
2>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _inflateInit2_
2>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateInit2_
2>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _crc32
2>assimp.lib(unzip.obj) : error LNK2001: unresolved external symbol _get_crc_table
2>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateSetDictionary
2>assimp.lib(XFileParser.obj) : error LNK2001: unresolved external symbol _inflateReset
2>C:\pathto\myproject.exe : fatal error LNK1120: 7 unresolved externals[/source]
I have tried removing the ZLIB_WINAPI flag from the zlib project, and I still get these errors. I have even tried linking my project to zlib.lib, adding these functions to assimp's "General -> Librarian -> Exported Name Functions" list, and still no dice. Does anyone know how to solve this?
Advertisement
Well, after I added the same preprocessor flags that zlib uses into Assimp's project settings, and changed all "extern" keywords in unzip.h and unzip.c to "ZEXTERN", the errors disappeared.

This topic is closed to new replies.

Advertisement