Ask Your Question

cs4711's profile - activity

2018-10-02 07:27:14 -0500 received badge  Popular Question (source)
2016-03-17 06:08:17 -0500 commented question static lib cross-compile zlib error

do you mean these lines?:

set(FLOAT_ABI_SUFFIX "")
find_program(CMAKE_C_COMPILER NAMES arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-g++)
set(ARM_LINUX_SYSROOT /usr/arm-linux-gnueabi${FLOAT_ABI_SUFFIX} CACHE PATH "ARM cross compilation system root")
2016-03-17 05:48:41 -0500 received badge  Editor (source)
2016-03-17 05:46:27 -0500 commented question static lib cross-compile zlib error

aaaah! thank you! this solved:

--   C/C++:
--     Built as dynamic libs?:      NO

zlib problem still remains..

2016-03-17 05:39:33 -0500 asked a question 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!