简体   繁体   English

编译C ++代码或x264本身时找不到libx264.so.146

[英]libx264.so.146 not found while compiling C++ code or x264 itself

I just upgraded my system from Ubuntu 15.10 to Ubuntu 16.04 LTS. 我刚刚将系统从Ubuntu 15.10升级到Ubuntu 16.04 LTS。 Now, for some reason my C++ project won't compile anymore. 现在,由于某种原因,我的C ++项目将不再编译。 CLion keeps saying it's missing 'libx264.so.146 as you can see in the compile log: 如您在编译日志中所见,CLion一直说它缺少'libx264.so.146:

/home/lorre851/CLion/bin/cmake/bin/cmake --build /home/lorre851/.CLion12/system/cmake/generated/ce7171e4/ce7171e4/Release --target main -- -j 8
[ 20%] Linking CXX executable build/main
/usr/bin/ld: warning: libx264.so.146, needed by /usr/local/lib/libavcodec.so.57, not found (try using -rpath or -rpath-link)
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_open_146'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_close'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_bit_depth'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_headers'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_encode'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_reconfig'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_param_parse'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_param_apply_profile'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_param_apply_fastfirstpass'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_levels'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_picture_init'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_param_default'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_param_default_preset'
/usr/local/lib/libavcodec.so.57: undefined reference to `x264_encoder_delayed_frames'
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:172: recipe for target 'build/main' failed
make[3]: *** [build/main] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed
make[2]: *** [CMakeFiles/main.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/main.dir/rule' failed
make[1]: *** [CMakeFiles/main.dir/rule] Error 2
Makefile:118: recipe for target 'main' failed
make: *** [main] Error 2

Most people seem to give 'reinstalling x264' as a solution. 大多数人似乎提供“重新安装x264”作为解决方案。 However, reinstalling x264 with the following commands leads to the same error while compiling x264 itself. 但是,在编译x264本身时,使用以下命令重新安装x264会导致相同的错误。

git clone git://git.videolan.org/x264
cd x264
./configure --enable-static
make

/usr/bin/ld: warning: libx264.so.146, needed by /usr/local/lib/libavcodec.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libavcodec.so: undefined reference to `x264_encoder_open_146'
collect2: error: ld returned 1 exit status
Makefile:202: recipe for target 'x264' failed
make: *** [x264] Error 1

Does anyone have an idea how I could get around this? 有谁知道我如何解决这个问题?

Okay, after a day of trying to remove and recompile the liavcodec-dev library, without result, I decided to format the drive and reinstall Ubuntu from scratch. 好的,经过一天的尝试删除并重新编译liavcodec-dev库,但没有结果,我决定格式化驱动器并从头开始重新安装Ubuntu。

Everything is working fine now. 现在一切正常。

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

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