static lib cross-compile zlib error
Hi,
I was able to successfully cross-compile OpenCV 3.1 for ARM on Ubuntu 14.04 by following this tutorial: http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html
Now I want to build it with static libraries by adding the options
-DBUILD_SHARED_LIBS=OFF -DBUILD_ZLIB=O
resulting in
cmake -DSOFTFP=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_ZLIB=ON -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake ../../..
CMake output:
-- C/C++:
-- Built as dynamic libs?: NO
-- C++ Compiler: /usr/bin/arm-linux-gnueabi-g++ (ver 4.7.3)
...
-- Media I/O:
-- ZLib: build (ver 1.2.8)
-- JPEG: libjpeg (ver 90)
-- WEBP: build (ver 0.3.1)
-- PNG: build (ver 1.6.19)
-- TIFF: build (ver 42 - 4.0.2)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: build (ver 1.7.1)
-- GDAL: NO
And I constantly get this error when running make:
...
[ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/trees.c.o
[ 1%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/uncompr.c.o
[ 2%] 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] Error 2
make[1]: *** [3rdparty/zlib/CMakeFiles/zlib.dir/all] Error 2
make: *** [all] Error 2
I checked the 3rdparty/lib directory, and there is no libzlib.a.
Any ideas on what I'm doing wrong here? Thanks!
it should be
-DBUILD_SHARED_LIBS=OFF
(underscore, not hyphen)aaaah! thank you! this solved:
zlib problem still remains..
can it be, it's not finding the correct linker, i.e, you toolchain is not setup correctly ?
http://answers.opencv.org/question/35...
do you mean these lines?: