opencv cross compile

hi all

i faced some problem on my beagleboard xm rev-c and wanted to share
with you

i can cross compile simple c(like hello world) program on ubuntu
desktop and i can make it work in beagle board but

i also can create opencv project in eclipse ubuntu but not for arm
proccessors, just works my desktops.

but problem comes with when i try the put same cross compiler settings
to the opencv compiling i face errors like:

**** Build of configuration bb_debug for project Copy of beagle_cplas

Hi Baran,

I too faced the nearly the same style difficulty in cross-compiling an
OpenCV application in Ubuntu-desktop like you.

See if the below blog helps:
http://carboncopycat.wordpress.com/2011/12/21/cross-compile-a-beagleboard-arm-opencv-application-2/

In that blog, I still can't apt-get the liblas-armel-cross and
liblapack-armel-cross to install properly on my Ubuntu desktop.
To circumvent that, I had to copy over those ARM libraries from the
beagleboard:/usr/lib to the desktop:/usr/arm-linux-gnueabi/lib. (I
hope someone else can help me with the desktop-installation of the
above libraries).

Warmest Regards,
Adnan

Hi Adnan

First of all thanx for ur kindly reply

i've just came home i will let you know my test based on your help

your sincerely..

Hi Adnan

First of all thanx for your kindly reply

I've just came home and i will test your reply and inform you as soon
as possible

your sincerely..

Have ever tried something like Buildroot (http://buildroot.uclibc.org/)? Buildroot will take care of toolchain, cross-compiling etc. You'll only have to create a package for your project. See following slides for more details: http://free-electrons.com/~thomas/pub/buildroot.pdf and this article too: http://free-electrons.com/blog/buildroot-2011-11/

Yegor

Hi Adnan

first of all sory for late reply

i did some steps more but still have problem

1-i cross compiled and installed whole opencv libraries to my desktop
pc

When i put these libraries to eclipse with cross compiling settings i
faced some problem

errors are

**** Build of configuration bb_debug for project Copy of
baran_beagle_cplas ****

make all
Building target: baran_beagle_cplas
Invoking: GCC C++ Linker
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -L/usr/
local/lib -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib -
o"baran_beagle_cplas" ./baran_beagle_cplas.o -lopencv_core -
lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -
lopencv_features2d -lopencv_objdetect -lopencv_contrib -lopencv_legacy
-lopencv_flann -lopencv_calib3d
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_core.so, needed by /usr/local/lib/libopencv_imgproc.so,
not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_imgproc.so, needed by /usr/local/lib/
libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_highgui.so, needed by /usr/local/lib/
libopencv_features2d.so, not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_flann.so, needed by /usr/local/lib/
libopencv_features2d.so, not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_features2d.so, needed by /usr/local/lib/
libopencv_objdetect.so, not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_calib3d.so, needed by /usr/local/lib/
libopencv_objdetect.so, not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_ml.so, needed by /usr/local/lib/libopencv_contrib.so,
not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_video.so, needed by /usr/local/lib/libopencv_contrib.so,
not found (try using -rpath or -rpath-link)
/usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/
4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: warning: ../../
lib/libopencv_objdetect.so, needed by /usr/local/lib/
libopencv_contrib.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libopencv_core.so: undefined reference to
`pthread_key_create'
/usr/local/lib/libopencv_core.so: undefined reference to
`pthread_getspecific'
/usr/local/lib/libopencv_core.so: undefined reference to
`pthread_once'
/usr/local/lib/libopencv_core.so: undefined reference to
`clock_gettime'
/usr/local/lib/libopencv_core.so: undefined reference to
`pthread_setspecific'
collect2: ld returned 1 exit status
make: *** [baran_beagle_cplas] Error 1

Can somebody say the what the problem is please because i can see that
all the cross-compiled libraries can be found in usr/local/lib :frowning:

by the way thanx yegor for your reply i will look at it and report the
results

Hi Adnan,

Did you solve the problem? I have same problem now and i dont know what should i do. I took exactly same errors with you. My eclipse + cross compiler works well but when i try to integrate opencv to it, it sucks.

Thank you.

Hey tun,
Did you solve it? I got the same, I can only compile codes without opencv…
thanks a lot.