views:

505

answers:

2

I am using a external library of libharu-2.0.8, this is a open source pdf library. This lib have a lib file called libhpdf.lib and few header files

I have written a simple code to use this library. I am getting following errors.

libhpdf.lib(hpdf_streams.obj) : error LNK2001: unresolved external symbol _deflateEnd libhpdf.lib(hpdf_streams.obj) : error LNK2001: unresolved external symbol _deflate libhpdf.lib(hpdf_streams.obj) : error LNK2001: unresolved external symbol deflateInit

please help.

+4  A: 

They're calls to the zlib library functions, so you'll probably find that libhpdf has a dependency on that library.

In fact, if you go to http://libharu.sourceforge.net/, you'll see that you need both zlib and pnglib.

Quoting that page here:

In addition, ZLIB and PNGLIB are required when you want to use the features of compression and embedding PNG images. (In the case of Windows, static library files for several compilers are included in the package for WIndows. In the case of most of UNIX, these libraries are usually installed.)

paxdiablo
Thank you for the reply. you mean I need to download zlib and pnglib library files? but pnglib is not available in windows platform it seems please help.
Sachin
Yes, you need to download at least zlib to get rid of the link error.
Timo Geusch
A: 

You could find the files: libpng.lib and zlib.lib already included in the package "libharu_2_0_8_win32.zip" in the directory: libharu_2_0_8_win32\libharu-2.0.8\win32\msvc\ Simply add these files to your project and the errors disapear.

Joern_g