1

While trying to compile program, that uses zlib, i got following errors:

Error 1 error LNK2019: unresolved external symbol _compress referenced in function "void __cdecl save_image_in_pakfile(class std::basic_ofstream > &,struct _IplImage *)" (?save_image_in_pakfile@@YAXAAV?$basic_ofstream@DU?$char_traits@D@std@@@std@@PAU_IplImage@@@Z) buffer_management.obj

Error 2 error LNK2001: unresolved external symbol _compress fern_based_point_classifier.obj

And two more same errors but related to uncompress function.

I use the vs2008 C++, and at the project properties I added in C/C++ : Additional include directories the path to header files of zlib. And at linker properties I added at additional dependencies: zlibwapi.lib and zlibstat.lib files.

How to resolv the problem? If I made some mistakes please show me them..

skaffman
  • 398,947
  • 96
  • 818
  • 769
maximus
  • 4,201
  • 15
  • 64
  • 117
  • Is zlib code compiled as C code or as C++ code? – sharptooth Jul 15 '10 at 10:51
  • zlib code goes with vs2008 project. So I just opened and compiled it. – maximus Jul 15 '10 at 11:19
  • 2
    You really should look at the compiler settings for the zlib source files. – sharptooth Jul 15 '10 at 11:44
  • So you think there must not be any mistakes in the project that uses zlib, but only in zlib project? – maximus Jul 16 '10 at 01:53
  • I've downloaded another sources with VS2008 project files of zlib and choose "LIB debug" configuration. So the project that uses zlib compiled successfuly! You were right, I should have changed the zlib's compiler settings. But I still do not know what setting have to be changed at the old zlib project, I should compare to projects's settings in order to understand it. – maximus Jul 16 '10 at 02:05

0 Answers0