解决XBMC运行时提示 undefined symbol

  • Post author:
  • Post category:Ubuntu
  • Post comments:0评论

安装了最新的XBMC后,发现无法播放任何视频文件。表现为点击视频文件后没有反应,或者提示无法播放视频。查看在~/.xbmc目录下的log文件发现问题出在这一部分:

Unable to load /usr/lib/xbmc/system/players/dvdplayer/avformat-52-i486-linux.so, reason: /usr/lib/xbmc/system/players/dvdplayer/avformat-52-i486-linux.so: undefined symbol: BZ2_bzDecompressInit

即avformat-52-i486-linux.so动态链接库无法找到符号BZ2_bzDecompressInit,而BZ2_bzDecompressInit是另外一个动态链接库libbz2.so中的一个函数。熟悉gcc的人可能就明白了,这是由于xbmc无法加载到libbz2.so库引起的,所以我们需要手动指定xbmc加载这个动态库。 首先找到本机中libbz2.so的位置(可能需要安装相应的软件包:libbz2)。在我的Ubuntu11.10中,libbz2.so位于/lib目录下面,其文件名为libbz2.so.1.0.4,因而在xbmc运行前使用export LD_PRELOAD=”/lib/libbz2.so.1.0.4″指定该库的位置即可。可以编辑/usr/bin/xbmc文件,将export LD_PRELOAD=”/lib/libbz2.so.1.0.4″加入该文件头部。

#  File:/usr/bin/xbmc
#  This Program is distributed in the hope that it will be useful,
......

SAVED_ARGS="$@"
prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"
LIBDIR="${exec_prefix}/lib"

#add libbz2 here
export LD_PRELOAD="/lib/libbz2.so.1.0.4"
# Check for some options used by this script
.......

继续阅读解决XBMC运行时提示 undefined symbol