Ask Your Question
0

I just can't install OpenCV on Ubuntu 10.04 x86_64

asked 2013-05-11 12:09:34 -0600

greenlady gravatar image

updated 2013-05-11 12:21:48 -0600

unxnut gravatar image

Hi all I am trying to install opencv on a ubuntu 10.04 x86_64. I followed these instructions link text but when I run make I got this message

> make [  0%]
> Built target opencv_core_pch_dephelp [  0%]
> Built target pch_Generate_opencv_core [  3%]
> Built target opencv_core [  4%]
> Built target opencv_ts_pch_dephelp [  4%]
> Built target pch_Generate_opencv_ts [ 4%]
> Built target opencv_imgproc_pch_dephelp [  4%]
> Built target pch_Generate_opencv_imgproc [  9%]
> Built target opencv_imgproc [  9%]
> Built target opencv_flann_pch_dephelp [  9%]
> Built target pch_Generate_opencv_flann [  9%]
> Built target opencv_flann [  9%]
> Built target opencv_highgui_pch_dephelp [ 9%]
> Built target pch_Generate_opencv_highgui
> Linking CXX shared library ../../lib/libopencv_highgui.so
> /usr/bin/ld:
> /usr/local/lib/libavcodec.a(avpacket.o):
> relocation R_X86_64_32 against
> `.rodata.str1.1' can not be used when
> making a shared object; recompile with
> -fPIC /usr/local/lib/libavcodec.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make[2]: ***
> [lib/libopencv_highgui.so.2.4.5] Error
> 1 make[1]: ***
> [modules/highgui/CMakeFiles/opencv_highgui.dir/all]
> Error 2 make: *** [all] Error 2
edit retag flag offensive close merge delete

Comments

I am having a similar problem on Ubuntu 13.04 x86_64. My exact error is:

Linking CXX shared library ../../lib/libopencv_highgui.so /usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet_nofree' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libavcodec.a: could not read symbols: Bad value

unxnut gravatar imageunxnut ( 2013-05-11 12:23:59 -0600 )edit

how do you think to fix it? I'm desperate

greenlady gravatar imagegreenlady ( 2013-05-11 17:36:22 -0600 )edit

Don't build with avcodec support, try to remove libavcodec if you don't really need it. it seems to be the blocker. apt-get purge libavcodec-*

ApriOri gravatar imageApriOri ( 2013-05-11 19:21:03 -0600 )edit

I uninstalled libavcodec $ sudo apt-get remove libavcodec-dev libavcodec-extra-52 libavcodec-unstripped-52 libavcodec52
Reading package lists... Done Building dependency tree
Reading state information... Done Package libavcodec-dev is not installed, so not removed Package libavcodec-extra-52 is not installed, so not removed Package libavcodec-unstripped-52 is not installed, so not removed Package libavcodec52 is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 310 not upgraded.

then I checked /usr/local/lib $ ls /usr/local/lib/libavls: cannot access /usr/local/lib/libav: No such file or directory

But still it doesn't work... It seems to need avcodec! $ make [ 0%] Built target opencv_core_pch_dephelp [ 0%] Built target pch_Generate

greenlady gravatar imagegreenlady ( 2013-05-12 02:55:30 -0600 )edit

[ 0%] Built target pch_Generate_opencv_core [ 3%] Built target opencv_core [ 4%] Built target opencv_ts_pch_dephelp [ 4%] Built target pch_Generate_opencv_ts [ 4%] Built target opencv_imgproc_pch_dephelp [ 4%] Built target pch_Generate_opencv_imgproc [ 9%] Built target opencv_imgproc [ 9%] Built target opencv_flann_pch_dephelp [ 9%] Built target pch_Generate_opencv_flann [ 9%] Built target opencv_flann [ 9%] Built target opencv_highgui_pch_dephelp [ 9%] Built target pch_Generate_opencv_highgui Linking CXX shared library ../../lib/libopencv_highgui.so /usr/bin/ld: cannot find -lavcodec

greenlady gravatar imagegreenlady ( 2013-05-12 02:55:54 -0600 )edit

Linking CXX shared library ../../lib/libopencv_highgui.so /usr/bin/ld: cannot find -lavcodec collect2: ld returned 1 exit status make[2]: * [lib/libopencv_highgui.so.2.4.5] Error 1 make[1]: [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: ** [all] Error 2

greenlady gravatar imagegreenlady ( 2013-05-12 03:03:37 -0600 )edit

After removing avcodec run cmake again. then make.

ApriOri gravatar imageApriOri ( 2013-05-12 13:42:25 -0600 )edit

I did that but no luck. I removed avcodec, ran cmake, and then, make. I was still stuck on highgui. I'll like to know if anyone has got it installed and running on Ubuntu.

unxnut gravatar imageunxnut ( 2013-05-12 16:54:53 -0600 )edit

I did, It all went ver smooth, I compiled with java and opencl support, on ubuntu 12.04.

ApriOri gravatar imageApriOri ( 2013-05-12 17:57:32 -0600 )edit

i removed libavcodec with $ sudo apt-get remove libavcodec* $ rm /usr/local/lib/libav* but still it doesn't wrk $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. $ make ... [ 9%] Built target pch_Generate_opencv_highgui Linking CXX shared library ../../lib/libopencv_highgui.so /usr/bin/ld: cannot find -lavcodec collect2: ld returned 1 exit status make[2]: * [lib/libopencv_highgui.so.2.4.5] Error 1 make[1]: [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: ** [all] Error 2

greenlady gravatar imagegreenlady ( 2013-05-14 04:07:07 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-10-09 09:34:45 -0600

jerry gravatar image

updated 2014-10-09 09:35:57 -0600

go to /usr/local/lib/ and keep backup all static libraries (.a files). then delete one by one those who are causing problem. It helped me to overcome.

edit flag offensive delete link more
0

answered 2013-05-14 05:01:23 -0600

_Misha_ gravatar image

updated 2013-05-14 05:31:33 -0600

May be, to find answer at YouTube... There are some deb-binaries at Debian site (I have find v.2.4.3).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-11 12:09:34 -0600

Seen: 2,398 times

Last updated: Oct 09 '14