Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    problems in building opencv on ubuntu (zlib.h: No such file or direct)


    Hi all,

    I have serious problems in installing opencv by source on my ubuntu machine (Linux 2.6.32-24-generic #43-Ubuntu SMP ... x86_64 GNU/Linux).

    Firstly I run cmake and then I execute make. After having executed make I have the following problems:

    [ 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!
    Is there anyone that knows how to solve this problem?


    Saverio

  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    2,103
    You probably need the zlib development files installed:
    Code:
    sudo apt-get install zlib1g-dev

  3. #3
    I am working on a shared machine and I cannot use the package manager.
    I have to install all on my own local directory
    Anyway zlib.h is in /usr/include/zlib.h.
    In addition during the configuration phase, cmake outputs:

    -- ZLib: /usr/lib64/libz.so (ver 1.2.3.3)

    However zlib.h is not found in the building phase, that is to say when I run make.

    Do you suggest to try to install manually the library? How can I do that?
    Last edited by savio78; 05-06-2015 at 06:05 PM.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    2,103
    It seems the include path isn't set.There's a couple of ways to deal with it. You could try exporting C_INCLUDE_PATH from the shell before executing make.
    Code:
    export CPLUS_INCLUDE_PATH=/usr/include
    You can modify the makefile to set CPPFLAGS (or possibly CFLAGS) to add -I/usr/include.

    It seems the configuration phase should be setting that up though.

  6. #5
    -->
    Actually there has been a small improvement but now I have another problem, always in the building phase.
    The output is the following:

    Linking CXX static library ../lib/libIlmImf.a
    [ 9%] Built target IlmImf
    Scanning dependencies of target opencv_core
    [ 9%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/gl_core_3_1.cpp.o
    In file included from /shared/sav/opencv-2.4.11/modules/core/src/gl_core_3_1.cpp:46:
    /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/core.hpp:4854: warning: `class cv::TLSDataContainer' has virtual functions but non-virtual destructor
    In file included from /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/core.hpp:4883,
    from /shared/sav/opencv-2.4.11/modules/core/src/gl_core_3_1.cpp:46:
    /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/operations.hpp:4101: error: got 2 template parameters for `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)'
    /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/operations.hpp:4101: error: but 1 required
    /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/operations.hpp:4110: error: redefinition of `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)'
    /shared/sav/opencv-2.4.11/modules/core/include/opencv2/core/operations.hpp:4101: error: `void cv::AlgorithmInfo::addParam(cv::Algorithm&, const char*, cv::Ptr<T>&, bool, cv::Ptr<T> (cv::Algorithm::*)(), void (cv::Algorithm::*)(const cv::Ptr<T>&), const std::string&)' previously declared here
    make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/gl_core_3_1.cpp.o] Error 1
    make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
    make: *** [all] Error 2

    Does anyone know how to solve this problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •