The problem in building opencv via eclipse

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

The problem in building opencv via eclipse

Jump to solution
1,933 Views
茂实丁
Contributor II

Hello everybody!

  

I'm trying to compile opencv example in eclipse enviroment.I followed the doc https://community.freescale.com/docs/DOC-106613

.I modified  the  makefile.am like the following :

------------------------------------------------------------

bin_PROGRAMS = opencv_sample

opencv_sample_SOURCES = opencv_sample.cpp

AM_CXXFLAGS = @opencv_sample_CFLAGS@ -I/home/ding/fsl-community-bsp/buildimx/tmp/sysroots/imx6sxsabresd/usr/include

AM_LDFLAGS = @opencv_sample_LIBS@   -L/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/opencvlib  -lopencv_core  -lopencv_highgui  -lopencv_imgproc -lopencv_photo

CLEANFILES = *~

-------------------------------------------------------------------------------------

but the eclipse console always says:

-------------------------------------------------------------------------------------

make all

make  all-recursive

make[1]: 正在进入目录 `/home/ding/workspace/opencv_sample'

Making all in src

make[2]: 正在进入目录 `/home/ding/workspace/opencv_sample/src'

../arm-poky-linux-gnueabi-

libtool  --tag=CXX   --mode=link arm-poky-linux-gnueabi-g++  -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I/home/ding/fsl-

community-bsp/buildimx/tmp/sysroots/imx6sxsabresd/usr/include  -g -O0  --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -L/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-

gnueabi/opencvlib  -lopencv_core  -lopencv_highgui  -lopencv_imgproc -lopencv_photo --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi   -o opencv_sample opencv_sample.o 

arm-

poky-linux-gnueabi-libtool: link: arm-poky-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi -I/home/ding/fsl-

community-bsp/buildimx/tmp/sysroots/imx6sxsabresd/usr/include -g -O0 --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi --sysroot=/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-

linux-gnueabi -o opencv_sample opencv_sample.o  -L/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/opencvlib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_photo

/opt/poky/1.8/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld:

cannot find /lib/libc.so.6

/opt/poky/1.8/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld:

cannot find /usr/lib/libc_nonshared.a

/opt/poky/1.8/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld:

cannot find /lib/ld-linux-armhf.so.3

make[2]:正在离开目录 `/home/ding/workspace/opencv_sample/src'

collect2: error: ld returned 1 exit status

make[1]:正在离开目录 `/home/ding/workspace/opencv_sample'

make[2]: *** [opencv_sample] 错误 1

make[1]: *** [all-recursive] 错误 1

-------------------------------------------------------------------------------------

What's the problem? ?

Best regards!  Thank you!

 

                 Ding

Labels (3)
0 Kudos
Reply
1 Solution
1,224 Views
茂实丁
Contributor II

Thank you yuri!   I used the wrong tool-chain.:smileyblush:

After changing the tool chain ,now it's OK!

Best regards

View solution in original post

0 Kudos
Reply
3 Replies
1,224 Views
茂实丁
Contributor II

PS :I can build "hello world " successfully. If i add -L/opt/poky/1.8/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/opencvlib ,file /lib/libc.so.6 .etc will missed.  If delete -L/XXX/XXX ,it can't find the library path. I have modifid ld.so.conf file in sysroots ,but it's useless .

What is the right way to add library path in eclipse?

Best  regards!

0 Kudos
Reply
1,224 Views
Yuri
NXP Employee
NXP Employee

Hello,

Have You tried the following ?

Help - Eclipse Platform

Help - Eclipse Platform


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,225 Views
茂实丁
Contributor II

Thank you yuri!   I used the wrong tool-chain.:smileyblush:

After changing the tool chain ,now it's OK!

Best regards

0 Kudos
Reply