cross compiling opencv with eclipse in ubuntu

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?


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.

链接地址: http://www.djcxy.com/p/86902.html

上一篇: 编译时如何链接gfortran?

下一篇: 在ubuntu中用eclipse交叉编译opencv