OpenCV c++ application cross compile for arm64

asked 2019-03-11 02:39:28 -0500

updated 2019-03-11 02:47:15 -0500

berak gravatar image

Hello,

I am new to opencv. Architecture is ARM64. I tried to cross compile the opencv application but getting the below error.

/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.4.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lopencv_imgcodecs
makefile:45: recipe for target 'test' failed
/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.4.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lopencv_core
/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.4.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lopencv_imgproc
/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.4.1/../../../../aarch64-linux-gnu/bin/ld: cannot find -lopencv_highgui
collect2: error: ld returned 1 exit status
make: *** [test] Error 1

Opencv version is 3.2 and Ubuntu version is 16.04 and I have taken opencv libraries from cross compiled Yocto project root file system.

I did not cross compile the opencv ver3.2

Just i used yocto cross compiled libraries to compile the application.

Please help me how to resolve this problem.

Thanks, Ram.

edit retag flag offensive close merge delete

Comments

I did not cross compile the opencv ver3.2

Just i used yocto cross compiled libraries to compile the application.

what does that mean ? please try to explain in more detail, how and where you obtained cross compiled opencv libs

berak gravatar imageberak ( 2019-03-11 02:49:40 -0500 )edit

Hi, Thanks for your reply. Build the Yocto Project it generates the rootFs. In rootFS opencv libraries there, those libraries are cross compiled. I just copied those libraries into my local directory and given the path of that local directory. While building the Yocto it takes all the necessary source code and cross compile it and generates the Kernel Images, DTB and ROOTFS.

Please let me know how to resolve this issue, or Please guide me how to cross compile OpenCV C++ application.

Thanks, Ram.

ramthota gravatar imageramthota ( 2019-03-11 03:26:41 -0500 )edit

Hi Berak,

I have seen one web link not able to find the solution. Please see the below link for your reference. http://answers.opencv.org/question/20...

Please help me how to resolve the library linking problem. I hope you understood my question now.

Thanks, Ram.

ramthota gravatar imageramthota ( 2019-03-11 05:21:38 -0500 )edit

Hi, Thanks for your support. The issue is resolved by cross compiling the opencv version 3.2 After compilation, In Eclipse changed library path to opencv/build/lib.

Thanks, Ram.

ramthota gravatar imageramthota ( 2019-03-12 02:28:19 -0500 )edit