Ask Your Question

/usr/lib/ undefined reference to `speex_header_free' error

asked 2013-01-30 00:34:39 -0500

fiyu gravatar image

Hi When i am trying to make OpenCv-2.4.2 i get this error:

Linking CXX executable ../../bin/opencv_perf_core /usr/lib/ undefined reference to `speex_header_free' collect2: ld returned 1 exit status make[2]: * [bin/opencv_perf_core] Error 1 make[1]: [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: ** [all] Error 2 Please guide me. Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-01-30 08:16:35 -0500

jukkaho gravatar image

updated 2013-01-30 08:27:05 -0500

This error means that linker does not find a symbol 'speex_header_free' that libavcodec (from ffmpeg) depends on. OpenCV has been compiled with FFMPEG support so this dependency comes from that. That symbol is needed because libavcodec has been compiled with support for speex codec.

One option is that speex library is installed to a path that the linker does not know about. If you use system package management to install all the components, this is unlikely.

Another option is that a different version of speex library has been installed on your system than what libavcodec/ffmpeg has been compiled against. This different speex library then does not export a symbol 'speex_header_free' that libavcodec expects and linker finds that problem.

You should try to make sure that a compatible speex library is in the library paths. You could also try to install FFMPEG without speex codec support to avoid this dependency. This would most likely need you to install it from the sources and that is out of the scope for my answer.

You could try running something like the following to see the missing libraries. Path could be a bit different for 32-bit libraries.

$ ldd /usr/lib64/

If can be found, then the found library version is probably wrong. If it's missing completely, you need to install correct version of speex library.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-01-30 00:34:39 -0500

Seen: 1,864 times

Last updated: Jan 30 '13