5

I'm going to build an open souce chat application named qutim (a Qt based applicatoin) . This application needs ZLib but according to this question this library is included in Qt itself. But when I want to configure it inside cmake I get this error :

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindZLIB.cmake:85 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  protocols/jabber/jreen/CMakeLists.txt:75 (find_package)

I even tried to add two environment variables ZLIB_LIBRARY and ZLIB_INCLUDE_DIR but it wasn't helpful. Every suggestion is appriciated!

Community
  • 1
  • 1
s4eed
  • 7,173
  • 9
  • 67
  • 104
  • 1
    That check for jreen searches for an independent zlib. Qt might or might not include zlib, depending on how it's built. I'd install the separate zlib to avoid the hassle. – Frank Osterfeld Apr 30 '14 at 05:35
  • The zlib library included in Qt is for Qt's own use. If a project needs zlib, you need to provide one - forget about Qt for the moment. – Kuba hasn't forgotten Monica May 01 '14 at 15:38

1 Answers1

9

I met the same problem on build libssh for win32. Fix by cmake ..\libssh -DZLIB_INCLUDE_DIR=....\include -DZLIB_LIBRARY=..\lib\lib

hopes it will help you.

Daniel Chen
  • 103
  • 7
  • 1
    Worked for me. I added `-DZLIB_LIBRARY:FILEPATH="C:/gtk_compilation/zlib-1.2.11/zlib.lib" -DZLIB_INCLUDE_DIR:PATH="C:/gtk_compilation/zlib-1.2.11"` and all was well. Thank you. – Lincoln Bergeson Feb 01 '17 at 00:11