0

I have used the following commands to install OpenCV 2.4.3 on my Linux Ubunbtu 12.04

cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=OFF -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D OPENCV_BUILD_3RDPARTY_LIBS=ON -D WITH_FFMPEG=ON -D WITH_GTK=ON -D WITH_OPENEXR=ON -D WITH_OPENNI=ON -D WITH_PNG=ON -D WITH_TBB=ON -D WITH_XINE=ON -D WITH_GSTREAMER=ON .

followed bythe make command. During the make, I get the following error.

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' 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.0] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2

I have updated linux. I am unable to figure out the error. Please help.

1

1 Answer 1

1

It seems a bug in the libav build system, not OpenCV. Thus, to discard this, you can try to recompile with -D WITH_FFMPEG=OFF

Anyway this post is duplicated: Strange linker error while compiling OpenCV2.3.1 on Ubuntu 11.10

Sign up to request clarification or add additional context in comments.

1 Comment

Sorry I just edited the answer, try with '-D WITH_FFMPEG=OFF'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.