error cross compiling for ARM
I'm trying to cross compile opencv from source (git tag 3.0.0-rc1 or 2.4 branch, doesn't matter) on Ubuntu trusty (PC 64Bit).
I always get errors at the very beginning, when the 3rd party stuff is built.
I've created a "build" folder in platform/linux and this is my cmake command line:
cmake -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ ../../..
While configuring, CMAKE tells about missing libs (zlib, jpeg ...) but nevertheless does not throw errors. "make" then tries to build the libraries itself, but fails when linking them. The error message is
"Linking C static library ../lib/libzlib.a Error running link command: No such file or directory".
I tried to avoid building these libraries by adding "-DZLIB_LIBRARY=..." and the like, but this does just let the build fail elsewhere with the same error message.
Building the same stuff on a native machine seems to work (I used an Odroid XU for that).
It might be because it is searching for those libraires in native environment and somehow failing to get it. An ideal way should be to build 3rd party libraries on the go by giving cmake parameter -D BUI:D_<lib>=ON. I'm not sure if it includes zlib. But i have done it with TBB and it helped me. Hope it helps.