Cross Compile Opencv

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cross Compile Opencv

3,459 Views
trendantenna
Contributor III

Hello everyone,

I'm trying to cross-compile an example of OpenCV 2.4.3 executing this:

     arm-linux-gnueabi-g++ main.cpp -o test1 `pkg-config opencv --libs` `pkg-config opencv --cflags`.

It returns the following error:

     /usr/local/lib/libopencv_calib3d.so: could not read symbols: File in wrong format

     collect2: ld returned 1 exit status

I already got the OpenCV libs compiled for ARM, and I'm using a wandoboard.

0 Kudos
6 Replies

988 Views
andre_silva
NXP Employee
NXP Employee

you can find the solution for Yocto and LTIB in the last 2 posts of this blog: http://imxcv.blogspot.com.br/

regards,

Andre

0 Kudos

988 Views
LeonardoSandova
Specialist I

I think the compiler is trying to use your HOST lib, which is an X86 binary. The problem is on the linking phase, so may export  something like this

export LD="<the arm loader>  --sysroot=<the target filesystem>"

Then compile.

In the future, try either creating a Makefile or even better, a Yocto recipe, so you got all this environment variables loaded for you.

Leo

988 Views
trendantenna
Contributor III

instead of "the target filesystem" should I put mi root filesystem path?

0 Kudos

988 Views
LeonardoSandova
Specialist I

That is correct.

In fact, can you try compiling your code after running these steps: i.MX Yocto Project: How can I compile the kernel manually?

0 Kudos

988 Views
trendantenna
Contributor III

what do you mean by "the arm loader"?

0 Kudos

988 Views
LeonardoSandova
Specialist I

Sorry, I mean the linker

arm-linux-gnueabi-ld