[CMake] problems in building opencv (zlib.h: No such file or directory)

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Fri May 8 11:05:43 EDT 2015


Hi Saverio,

Make sure you install zlib dev package. That way the header will be found
on the system.

On Ubuntu 14.04, you could do it using the following command:

$ sudo apt-get install zlib1g-dev

See http://packages.ubuntu.com/trusty/zlib1g-dev

Hth
Jc

On Wed, May 6, 2015 at 1:44 PM, Saverio Iacovelli <iacovelli_mail at yahoo.it>
wrote:

> Hi,
>
> I have serious problems in installing OpenCV 2.4 on my Ubuntu Linux
> machine (Linux 2.6.32-24-generic #43-Ubuntu SMP ... x86_64 GNU/Linux).
>
> Firstly I use cmake as below:
>
> cmake -D CMAKE_INSTALL_PREFIX:PATH=/pathwherebuilding /path-to-source
>
> Secondly I use make but there are the following errors:
>
> [  0%] Building CXX object
> 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o
> /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:75:18:
> zlib.h: No such file or directory
> /shared/sav/opencv-2.4.11/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:
> In member function `int Imf::Pxr24Compressor::compress(const char*, int,
> Imath::Box2i, const char*&)':
> ...
> ...
> ...
> make[2]: ***
> [3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfPxr24Compressor.cpp.o]
> Error 1
> make[1]: *** [3rdparty/openexr/CMakeFiles/IlmImf.dir/all] Error 2
> make: *** [all] Error 2
>
> I am completly stuck and I do not know how to proceed.
> How can I solve this problem?
>
> Thank you,
> Saverio
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150508/2ccb0825/attachment.html>


More information about the CMake mailing list