0
votes

I am able to cross compile hello world program in raspberry pi from my Ubuntu 14.04 PC through eclipse. But I am not able to cross compile opencv programs. I am getting following error:

15:19:20 ** Incremental Build of configuration Debug for project MyFirstRaspProg **

make all

Building target: MyFirstRaspProg

Invoking: Cross G++ Linker

arm-linux-gnueabi-g++ -L/home/tvsm/raspberry -L/usr/lib/gcc-cross/arm-linux-gnueabi/4.7 -L/usr/lib/i386-linux-gnu/lib -L/usr/arm-linux-gnueabi/lib -o "MyFirstRaspProg" ./src/MyFirstRaspProg.o -lopencv_highgui

/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lopencv_highgui

collect2: error: ld returned 1 exit status make: * [MyFirstRaspProg] Error 1

15:19:20 Build Finished (took 56ms)

Can anyone help how to resolve this?

1
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/ld: cannot find -lopencv_highgui - Normally means it cannot find the libraries. Check your include paths, system paths are all set up correctlyGPPK
I linked the opencv lib and gcc-cross/arm-linux-gneubi/4.7 lib in the library path in eclipse.. now it is giving an error saying "skipping incompatible /home/tvsm/Downloads/opencv-2.4.9/lib/libopencv_highgui.so when searching for -lopencv_highgui"Shreenivas

1 Answers

0
votes

The error is because you have specified arm-linux-gnueabi-g++ to refer a library, which is not available. So you need to cross compile the necessary library for ARM platform and link it during build.

Follow the below link to cross compile the opencv on Ubuntu machine.

http://www.ridgesolutions.ie/index.php/2013/05/24/building-cross-compiling-opencv-for-linux-arm/

You will be left with an "install" folder at the end of the process. In eclipse specify the library path and include path to "lib" & "include" folders in the "install" folder respectively.