0

I got the precompiled "lib" and "dll" from here: http://zlib.net/zlib128-dll.zip

I am compiling my project in x64.

I added directory into "Additional Include Directories"

I added the "zdll.lib" to Linker -> Additional Dependencies.

I added the library directory to Linker -> Additional Library Directories.

I also added the Post-Build Event "xcopy ..\oem\zlib\*.dll "$(TargetDir)"

But I still get the Linker error:

: error LNK2019: unresolved external symbol inflateInit_ referenced in function

Thanks.

John Mcdock
  • 1,219
  • 2
  • 11
  • 19
  • 3
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Richard Critten Jul 24 '16 at 20:59
  • You *don't* need to copy zlib dll's to the TargetDirectory. It is used only in build time. Did you try to link with /VERBOSE? Is zlib.lib shown there? – Ofek Shilon Aug 04 '16 at 19:23
  • @OfekShilon: Are you sure the DLLs are used during **build time**? That would really be extraordinary. – IInspectable Aug 28 '16 at 20:03

1 Answers1

0

IS that a 32-bit dll? If so, you'll have to obtain, or build your own, 64-bit version.

The linker error happens with the lib file, if you have the right headers it'll compile, if you have the right lib, it'll link, if you have the right dll, it'll run.

gbjbaanb
  • 51,617
  • 12
  • 104
  • 148