简体   繁体   English

安装OpenCV时出错

[英]Error while installing OpenCV

I have used the following commands to install OpenCV 2.4.3 on my Linux Ubunbtu 12.04 我已使用以下命令在Linux Ubunbtu 12.04上安装OpenCV 2.4.3

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. 然后是make命令。 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. 我已经更新了linux。 I am unable to figure out the error. 我无法找出错误。 Please help. 请帮忙。

It seems a bug in the libav build system, not OpenCV. 似乎是libav构建系统(而非OpenCV)中的错误。 Thus, to discard this, you can try to recompile with -D WITH_FFMPEG=OFF 因此,要放弃此设置,可以尝试使用-D WITH_FFMPEG=OFF重新编译

Anyway this post is duplicated: Strange linker error while compiling OpenCV2.3.1 on Ubuntu 11.10 无论如何,这篇文章是重复的: 在Ubuntu 11.10上编译OpenCV2.3.1时发生奇怪的链接器错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM