Ask Your Question
0

Linking error: libzlib

asked 2014-12-29 20:04:17 -0600

Letschi gravatar image

hi!

I try to cross-compile OpenCV for arm as described in the tutorial and have the following problem: I get following error after starting make:

root@debian:/home/martin/OpenCVArm/opencv-2.4.10/platforms/linux/build# make [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.c.o [ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.c.o [ 2%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.c.o [ 3%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.c.o [ 3%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzclose.c.o [ 4%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzlib.c.o [ 4%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzread.c.o [ 5%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzwrite.c.o [ 5%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inflate.c.o [ 6%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/infback.c.o [ 6%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inftrees.c.o [ 7%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inffast.c.o [ 7%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/trees.c.o [ 8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/uncompr.c.o [ 9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/zutil.c.o Linking C static library ../lib/libzlib.a Error running link command: No such file or directory make[2]: * [3rdparty/lib/libzlib.a] Fehler 2 make[1]: [3rdparty/zlib/CMakeFiles/zlib.dir/all] Fehler 2 make: ** [all] Fehler 2

When I start cmake I get the following warning: cmake -DCMAKE_TOOLCHAIN_FILE=../armgnueabi.toolchain.cmake../../.. -- Detected version of GNU GCC: 49 (409) -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least versio ...

I already disabled the most options with no effect: -- GUI: -- QT: NO -- GTK+ 2.x: NO -- GThread : NO -- GtkGlExt: NO -- OpenGL support: NO

-- VTK support: NO

-- Media I/O: -- ZLib: zlib (ver 1.2.7) -- JPEG: NO -- PNG: NO -- TIFF: NO -- JPEG 2000: NO

-- OpenEXR: NO

-- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: NO -- FFMPEG: NO -- codec: NO -- format: NO -- util: NO -- swscale: NO -- gentoo-style: NO -- GStreamer: NO -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: NO/NO -- XIMEA: NO

-- Xine: NO

-- Other third-party libraries: -- Use IPP: NO -- Use Eigen: NO -- Use TBB: NO -- Use OpenMP: NO -- Use GCD NO -- Use Concurrency NO -- Use C=: NO -- Use Cuda: NO

-- Use OpenCL: NO

-- Python:

-- Interpreter: /usr/bin/python2 (ver 2.7.3)

-- Java: -- ant: /usr/bin/ant (ver 1.8.2) -- JNI: NO

-- Java tests: NO

-- Tests and samples: -- Tests: NO -- Performance tests: NO -- C/C++ Examples: NO

Anyone an idea? Thanks in advance!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-11-01 03:47:29 -0600

AlaaM gravatar image

updated 2016-11-01 07:42:33 -0600

I found a workaround:

After running cmake and generating the make files, edit opencv/opencv/platforms/linux/<your_build_dir>/CMakeFiles/3.5.1/CMakeCCompiler.cmake and replace set(CMAKE_AR "CMAKE_AR-NOTFOUND") with set(CMAKE_AR "/usr/bin/arm-linux-gnueabi-ar")

Note that setting the variable CMAKE_AR in the cmake line (CMAKE_AR="/usr/bin/arm-linux-gnueabi-ar") does not work. Seems like this sets the flag to empty.

edit flag offensive delete link more

Comments

This works for me. but I don't know why it works...

katharine_fcy gravatar imagekatharine_fcy ( 2016-12-09 01:12:24 -0600 )edit
-1

answered 2015-04-21 06:00:42 -0600

haxan7 gravatar image

I had the same problem.

Make sure that the following line in your arm-gnueabi.toolchain.cmake file is pointing to the correct address

set(ARM_LINUX_SYSROOT /root/work/codesourcery/arm-2013.05 CACHE PATH "ARM cross compilation system root")

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-12-29 20:04:17 -0600

Seen: 3,162 times

Last updated: Nov 01 '16