Compilation Error: missing strange so library files

I was trying to compile opencv with Cuda support. I managed to compile most modules including the main opencv and contrib modules. My overall progress is at 94%. However, I encountered the following errors:

/usr/bin/ld: warning: libvpx.so.7, needed by /home/boyangli/app/lib/libavcodec.so.58, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libx264.so.164, needed by /home/boyangli/app/lib/libavcodec.so.58, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libx265.so.199, needed by /home/boyangli/app/lib/libavcodec.so.58, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_decode' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_close’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_headers' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_get_cx_data’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_encode' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x265_api_get_199’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_reconfig' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_vp9_cx’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_param_parse' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_error’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_maximum_delayed_frames' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_vp9_dx_algo’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_control_' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_err_to_string’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_set_frame_buffer_functions' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_open_164’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_param_apply_profile' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_get_caps’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_vp8_cx' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_param_apply_fastfirstpass’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_version' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_vp8_dx_algo’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_destroy' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_levels’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_build_config' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_encode’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_picture_init' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_param_default’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_param_default_preset' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_get_frame’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_error_detail' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_img_wrap’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_version_str' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_dec_init_ver’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to vpx_codec_enc_init_ver' /usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to x264_encoder_delayed_frames’
/usr/bin/ld: /home/boyangli/app/lib/libavcodec.so.58: undefined reference to `vpx_codec_enc_config_default’
collect2: error: ld returned 1 exit status

The funny thing is that libvpx.so.7 seems exceedingly rare. I have libvpx.so.5 and libvpx.so.6 on the library path, but not libvpx.so.7. In fact I cannot find any reference to this file on Google or Bing.

The same situations applies to libx264.so.164 and libx265.so.199.

Why would these files be required?

Any help would be greatly appreciated.

I figured out the problem. The problem happend when I tried to follow the installation guide at denseflow/INSTALL.md at master · open-mmlab/denseflow · GitHub

The guide builds libvpx.so.7 and other libraries beforehand and puts it in $HOME/app/lib. The solution is just to have that path in LD_LIBRARY_PATH.

1 Like