Reputation: 3568
Here is the error that I get:
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet' 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.3.1] Error 1 make[1]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 make: * [all] Error 2
Has anybody encountered an error like this? How do I work around it?
Upvotes: 1
Views: 3040
Reputation:
You have a problem with the FFMPEG. You need to recompile it with the --enable-shared option. That could probably do the deal for you.
Upvotes: 2
Reputation: 1565
that is the same tutorial I followed - however it is no good with 12.04 because you end up overwriting a number of libraries and (in my newbie case) reinstall everything sudo apt-get came to the rescue - but again you have to look at how the libraries are linked and use: $ g++ -o hello_world hello-world.cpp
pkg-config opencv --cflags --libs
(use back quote symbol) if you want anything to compile.
btw - best tutorial for opencv2 (installation and usage) ever: http://opencv.itseez.com/doc/tutorials/tutorials.html
Upvotes: 1
Reputation: 408
It looks like you are using older version of ffmpeg. You should use ffmpeg 0.8+. Here is the guide for ubuntu 12.04 which works for 11.10 as well
Upvotes: 1
Reputation: 5488
I installed OpenCV 2.3.1 on Ubuntu 11.10 couple days ago. All you have to do is to fallow the steps from http://www.ozbotz.org/opencv-installation/ Good luck!
Upvotes: 1