opencv cross compile

1,485 views
Skip to first unread message

Baran

unread,
Feb 7, 2012, 4:38:58 PM2/7/12
to Beagle Board
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
****

make all
Building target: beagle_cplas
Invoking: GCC C++ Linker
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -L/usr/
local/angstrom/arm/arm-angstrom-linux-gnueabi/lib -L/usr/lib -L/usr/
local/lib -o"beagle_cplas" ./beagle.o -lopencv_core -
lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -
lopencv_features2d -lopencv_calib3d -lopencv_objdetect -
lopencv_contrib -lopencv_legacy -lopencv_flann
/usr/local/lib/libopencv_core.so: file not recognized: File format not
recognized
collect2: ld returned 1 exit status
make: *** [beagle_cplas] Error 1

i face this problem, in other words i face this problem when i try to
put opencv libraries to my simple cross compiled c program

i need ur kindly guide

Adnan

unread,
Feb 7, 2012, 11:33:37 PM2/7/12
to Beagle Board
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

On Feb 8, 5:38 am, Baran <gigab...@gmail.com> wrote:
> 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:
...snipped...

Baran

unread,
Feb 8, 2012, 11:33:48 AM2/8/12
to Beagle Board
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..

On Feb 8, 6:33 am, Adnan <ad...@singnet.com.sg> wrote:
> HiBaran,
>
> 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-beagleb...
>
> 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
>
> On Feb 8, 5:38 am,Baran<gigab...@gmail.com> wrote:> hi all

Baran

unread,
Feb 8, 2012, 11:35:22 AM2/8/12
to Beagle Board
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..

On Feb 8, 6:33 am, Adnan <ad...@singnet.com.sg> wrote:
> HiBaran,
>
> 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-beagleb...
>
> 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
>
> On Feb 8, 5:38 am,Baran<gigab...@gmail.com> wrote:> hi all

yegor...@googlemail.com

unread,
Feb 9, 2012, 2:50:47 AM2/9/12
to beagl...@googlegroups.com
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

Baran

unread,
Feb 20, 2012, 1:10:18 PM2/20/12
to Beagle Board
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 :(

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



On Feb 9, 9:50 am, yegorsli...@googlemail.com wrote:
> 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.pdfand this article too:http://free-electrons.com/blog/buildroot-2011-11/
>
> Yegor

tun...@gmail.com

unread,
Mar 11, 2012, 3:50:39 PM3/11/12
to beagl...@googlegroups.com
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.

gmban...@gmail.com

unread,
Sep 17, 2013, 12:35:35 PM9/17/13
to beagl...@googlegroups.com, tun...@gmail.com
Hey tun,
Did you solve it? I got the same, I can only compile codes without opencv...
thanks a lot.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages