undefined reference to avcodec

asked 2015-04-23 03:30:37 -0500

haxan7 gravatar image

Opencv fails to compile with ffmpeg.

Opencv version is 2.4.10 and ffmpeg is v2.

I have tried everything cant seem to fix this error.

Here is the output of cmake:

-- checking for module 'libavcodec'
--   found libavcodec, version 56.35.101
-- checking for module 'libavformat'
--   found libavformat, version 56.30.100
-- checking for module 'libavutil'
--   found libavutil, version 54.23.101
-- checking for module 'libswscale'
--   found libswscale, version 3.1.101
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       codec:                     YES (ver 56.35.101)
--       format:                    YES (ver 56.30.100)
--       util:                      YES (ver 54.23.101)
--       swscale:                   YES (ver 3.1.101)
--       gentoo-style:              YES

Here is error:

Linking CXX executable ../../bin/opencv_test_core
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavcodec.so.56, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavformat.so.56, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libavutil.so.54, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)
/root/work/codesourcery/arm-2013.05/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libswscale.so.3, needed by ../../lib/libopencv_highgui.so.2.4.10, not found (try using -rpath or -rpath-link)

../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avpicture_fill@LIBAVCODEC_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_find_stream_info@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_free_packet@LIBAVCODEC_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_free_context@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_register_all@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `av_guess_codec@LIBAVFORMAT_56'
../../lib/libopencv_highgui.so.2.4.10: undefined reference to `avformat_new_stream@LIBAVFORMAT_56'
edit retag flag offensive close merge delete