错误建筑OpenCV的2.4.x的"未定义参考av_opt_set @ LIBAVUTIL_51" [英] Error building OpenCV 2.4.x "Undefined reference to av_opt_set@LIBAVUTIL_51"
问题描述
我已经试过建筑2.4所有版本,它们都失败时,链接CXX可执行../../bin/opencv_test_core有:
I have tried building all versions of 2.4, and they all fail when "Linking CXX executable ../../bin/opencv_test_core" with:
/usr/local/lib/libavcodec.so.54: undefined reference to `av_opt_set@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_strcasecmp@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_bprint_finalize@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_timecode_make_smpte_tc_string@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_timecode_make_string@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_realloc_f@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_timecode_get_smpte_from_framenum@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_timecode_init@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_samples_set_silence@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_calloc@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_opt_get@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_strncasecmp@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_samples_fill_arrays@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_get_media_type_string@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_dynarray_add@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_bprint_init@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_asprintf@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_sample_fmt_is_planar@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_samples_get_buffer_size@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_opt_get_int@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_timecode_make_mpeg_tc_string@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_rescale_q_rnd@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_bprintf@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_samples_copy@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_get_default_channel_layout@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_timecode_init_from_string@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_bprint_chars@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_des_mac@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_timecode_adjust_ntsc_framenum@LIBAVUTIL_51'
/usr/local/lib/libavformat.so.54: undefined reference to `av_timegm@LIBAVUTIL_51'
/usr/local/lib/libavcodec.so.54: undefined reference to `av_tempfile@LIBAVUTIL_51'
我的CMakeLists.txt文件是默认的,但我改变了它使用TBB,禁用文档,并打开详细模式。
My CMakeLists.txt file is the default, except I changed it to use TBB, disabled the docs, and turned on verbose mode.
做LDD /usr/local/lib/libav$c$cc.so.54我得到:
Doing ldd /usr/local/lib/libavcodec.so.54 I get:
root@omap4-multi:~/opencv/2.4.3/build# ldd /usr/local/lib/libavcodec.so.54
libavutil.so.51 => /usr/local/lib/libavutil.so.51 (0xb6132000)
libx264.so.123 => /usr/local/lib/libx264.so.123 (0xb5fc4000)
libvorbisenc.so.2 => /usr/local/lib/libvorbisenc.so.2 (0xb5e4a000)
libvorbis.so.0 => /usr/local/lib/libvorbis.so.0 (0xb5e14000)
libtheoraenc.so.1 => /usr/local/lib/libtheoraenc.so.1 (0xb5dcc000)
libtheoradec.so.1 => /usr/local/lib/libtheoradec.so.1 (0xb5dac000)
libopencore-amrwb.so.0 => /usr/local/lib/libopencore-amrwb.so.0 (0xb5d93000)
libopencore-amrnb.so.0 => /usr/local/lib/libopencore-amrnb.so.0 (0xb5d67000)
libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0xb5cdd000)
libfaac.so.0 => /usr/local/lib/libfaac.so.0 (0xb5cc1000)
libm.so.6 => /lib/libm.so.6 (0xb5c44000)
libz.so.1 => /usr/lib/libz.so.1 (0xb5c29000)
libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0xb5c02000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb5be3000)
libc.so.6 => /lib/libc.so.6 (0xb5ab8000)
libogg.so.0 => /usr/local/lib/libogg.so.0 (0xb5aac000)
/lib/ld-linux.so.3 (0x42228000)
任何人有任何想法,以什么可能会造成它,或者我能做些什么来解决这个问题?香港专业教育学院这方面的工作了相当一段时间,很茫然。任何帮助将是非常美联社preciated。
Anyone have any idea as to what may be causing it, or what I can do to fix it? Ive been working on this for quite awhile and am at a loss. Any help would be much appreciated.
推荐答案
我有这个问题为好。即使我重新编译的ffmpeg,问题仍然存在。最后,我意识到从源头code安装与安装的lib apt-get的
,我的意思的ffmpeg之间的冲突 libavutil-dev的
, libavutil-EXTRA-51
。只需用删除ffmpeg的apt-get的删除的ffmpeg
并没有解决这个问题。我的解决方案是删除从安装冲突的lib易
如下:
I have this problem as well. Even after I re-compile ffmpeg, the problem still remains. Finally, I realise a conflict between ffmpeg installed from source code with the lib installed by apt-get
, I mean libavutil-dev
, libavutil-extra-51
. Simply removing ffmpeg using apt-get remove ffmpeg
did not solve this problem. My solution is is to remove the conflict lib installed from apt
as follows:
sudo apt-get remove libavutil-dev libavutil-extra-51
希望这是对你有用。
Hope it's useful to you.
这篇关于错误建筑OpenCV的2.4.x的"未定义参考av_opt_set @ LIBAVUTIL_51"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!