加载中…
个人资料
南冠彤
南冠彤
  • 博客等级:
  • 博客积分:0
  • 博客访问:412,759
  • 关注人气:59
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
谁看过这篇博文
加载中…
正文 字体大小:

[转载]在CentOS5.5(2.6.18)编译VLC

(2014-05-07 13:48:39)
标签:

转载

分类: linux
1.下载vlc-1.1.5.tar.bz2:http://www.videolan.org/vlc/download-sources.html
2.解压后开始编译,执行配置:./configure --enable-debug --enable-dvbpsi
  报告错误:
configure: error: Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
work-around for this. Check with your distribution vendor on how to update the
glibc run-time. Alternatively, build with --disable-nls --disable-mozilla and
be sure to not use LibVLC from other applications/wrappers.
3.重新执行配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
  报告错误:
configure: error: Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.
4.下载lua-5.2.0-alpha.tar.gz,结果,在执行make linux时,报告错误:
gcc -o lua  lua.o liblua.a -lm -Wl,-E -ldl -lreadline
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `PC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `BC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
于是:
wget  http://www.lua.org/ftp/lua-5.1.4.tar.gz
tar xvfz lua-5.1.4.tar.gz
cd lua-5.1.4
make linux
make install
cp etc/lua.pc /usr/lib/pkgconfig/
5.再次执行vlc配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
报告错误:
configure: error: Could not find libmad on your system: you may get it from http://www.underbit.com/products/mad/. Alternatively you can use --disable-mad to disable the mad plugin.
6.从ftp://ftp.mars.org/pub/mpeg/ 下载安装包:libmad-0.15.1b.tar.gz,执行:
tar -zxvf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
./configure
make
make install
7.再次执行vlc配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
报告错误:
checking for AVCODEC... no
configure: error: Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.
8.由于已安装完成ffmpeg,所以还需要指定软件包的位置:
export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
完成之后,可通过以下命令进行验证:
[root@centos1101 vlc-1.1.5]# pkg-config --modversion libavcodec
52.72.2
9.
再次执行vlc配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
报告错误:
checking for POSTPROC... no
configure: error: Could not find libpostproc. Use --disable-postproc to ignore this error.
10.重新编译ffmpeg:
在安装ffmpeg.0.6.1时,执行
./configure --prefix=/usr --enable-gpl --enable-swscale --enable-postproc --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libfaad --enable-libfaadbin --enable-nonfree --enable-libfaac --enable-libx264 --enable-version3 --enable-pthreads
make
make install
11.再次执行vlc配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
报告错误:
checking for XCB... no
configure: error: Package requirements (xcb) were not met:
No package 'xcb' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables XCB_CFLAGS
and XCB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
12.需要安装libxcb,而libxcb还需要xcb-proto和libpthread-stubs,并由Python编译,因此我进行了如下操作:
1)下载http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tgz,并执行:
tar -zxvf Python-3.1.3.tgz
cd Python-3.1.3
./configure
make
make install
2)下载http://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.gz,并执行:
./configure
make
make install
3)下载http://xcb.freedesktop.org/dist/xcb-proto-1.6.tar.gz,并执行:
./configure
make
make install
4)最后下载http://xcb.freedesktop.org/dist/libxcb-1.7.tar.gz,并执行:
./configure
make
make install
期间,我还下载了libxcb-1.6.tar.gz,libxcb-1.5.tar.gz,libxcb-1.4.tar.gz,结果,不是在configure时报告错误“找不到Python”:
checking for a Python interpreter with version >= 2.5... none
configure: error: no suitable Python interpreter found
或报告错误“Python需要>=2.5,当前的Python版本 too old",
就是在make时报告错误:
Failed to load the xcbgen Python package!
Make sure that xcb/proto installed it on your Python path.
经查,有资料说Python3.x与Python2.x有很大的差异,没办法,只得全部make distclean,再将以上操作全部重新执行一遍,重要的是将Python版本替换为2.7:http://www.python.org/ftp/python/2.7/Python-2.7.tgz
终于,将libxcb install完毕。
13.再次执行vlc配置:./configure --enable-debug --enable-dvbpsi --disable-nls --disable-mozilla
报告错误:
checking for XLIB_XCB... no
configure: error: Package requirements (x11-xcb) were not met:
No package 'x11-xcb' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables XLIB_XCB_CFLAGS
and XLIB_XCB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
14.这个没有找到package 'x11-xcb'的错误真把人折腾死了,起初以为是缺少XWindows的开发环境,安装完毕后错误依旧…… 查了两天,看了无数的国内外论坛,得到的概念是:libX11应该在xcb绑定的基础上进行编译,也就是说应该先装libxcb,再make/install libX11,而系统默认安装的libX11版本为1.0.3,因此前去ftp://ftp.freedesktop.org/pub/xorg/X11R7.4/src/lib/ 下载 xtrans-1.2.1.tar.gz 和libX11-1.1.5.tar.gz,去ftp://ftp.freedesktop.org/pub/xorg/X11R7.4/src/proto/ 下载xextproto-7.0.3.tar.gz,然后先make/install xextproto-7.0.3 和 xtrans,再make/install libX11,结果却报告错误:
checking for XLIB_XCB... no
configure: error: Package requirements (x11-xcb) were not met:
No package 'x11-xcb' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables XLIB_XCB_CFLAGS
and XLIB_XCB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
更换版本:libX11-1.1.3.tar.bz2 还是报告同样的错误。现在更晕菜了,几乎想放弃了。硬着头皮继续查,从大家的经历和分析感觉应该是系统的BUG,可参见:
http://bugs.gentoo.org/show_bug.cgi?id=158476 或
http://www.gentoo.org/proj/en/desktop/x/x11/libxcb-1.4-upgrade-guide.xml。
于是换高版本一搏,下载:http://www.x.org/releases/X11R7.6/src/lib/libX11-1.4.0.tar.gz 重新编译。通过!
15.回头继续执行vlc配置,终于跨过了“No package 'x11-xcb' found“这个坎儿。继续报错:
checking for FRIBIDI... no
configure: error: Package requirements (fribidi) were not met:
No package 'fribidi' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FRIBIDI_CFLAGS
and FRIBIDI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
直接执行 yum install fribidi ,yum install fribidi-devel
16.继续执行vlc配置,报告错误:
checking for QT4... no
configure: WARNING: Qt 4 library not found
configure: error: The skins2 module depends on a the Qt4 development package. Without it you won't be able to open any dialog box from the interface, which makes the skins2 interface rather useless. Install the Qt4 development package or alternatively you can also configure with: --disable-qt4 --disable-skins2.
在Add/Remove Software中,添加
qt4-4.2.1-1.x86_64
qt4-4.2.1-1.i386
qt4-devel-4.2.1-1.x86_64
qt4-devel-4.2.1-1.i386
qt4-doc-4.2.1-1.x86_64
之后,Qt 4 library not found 仍然出现,还需设置环境变量如下:
export QT4_CFLAGS="-I/usr/lib64/qt4/include/
-I/usr/lib64/qt4/include/Qt
-I/usr/lib64/qt4/include/QtAssistant
-I/usr/lib64/qt4/include/QtDBus
-I/usr/lib64/qt4/include/QtGui
-I/usr/lib64/qt4/include/QtOpenGL
-I/usr/lib64/qt4/include/QtSvg
-I/usr/lib64/qt4/include/QtUiTools
-I/usr/lib64/qt4/include/Qt3Support
-I/usr/lib64/qt4/include/QtCore
-I/usr/lib64/qt4/include/QtDesigner
-I/usr/lib64/qt4/include/QtNetwork
-I/usr/lib64/qt4/include/QtSql
-I/usr/lib64/qt4/include/QtTest
-I/usr/lib64/qt4/include/QtXml"
export QT4_LIBS="-I/usr/lib64/qt4/lib64/"
17.configure终于完成:
Enabled modules: a52tofloat32 access_alsa access_avio access_gnomevfs access_mmap access_oss alsa atmo avcodec avformat cdda dbus dynamicoverlay fb freetype globalhotkeys inhibit mpgatofixed32 mux_ogg notify ogg oldhttp oldtelnet osd_parser osdmenu oss panoramix png postproc qt4 remoteosd skins2 stream_out_raop svg swscale telepathy telx unzip v4l2 vcd visual vorbis x264 xcb_apps xcb_glx xcb_screen xcb_window xcb_x11 xcb_xv xdg_screensaver xml xscreensaver zip

libvlc configuration
--------------------
version               : 1.1.5
system                : linux
architecture          : x86_64 mmx sse sse2
build flavour         : debug
vlc aliases           : cvlc rvlc svlc qvlc
plugins/bindings      :

You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
18.执行make报错:
make[5]: Entering directory `/root/Download/vlc-1.1.5/modules/access'
......
  CC     libv4l2_plugin_la-v4l2.lo
v4l2.c: In function ‘OpenVideoDev’:
v4l2.c:1922: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 5 has type ‘v4l2_std_id’
v4l2.c:2193: error: ‘V4L2_FIELD_INTERLACED_TB’ undeclared (first use in this function)
v4l2.c:2193: error: (Each undeclared identifier is reported only once
v4l2.c:2193: error: for each function it appears in.)
v4l2.c:2197: error: ‘V4L2_FIELD_INTERLACED_BT’ undeclared (first use in this function)
原因是在/usr/include/linux/videodev2.h文件中没有定义枚举值,应获取2.6.25或以上版本的相应文件:
http://lxr.oss.org.cn/source/include/linux/videodev2.h?v=2.6.25;a=sparc#L5
19.执行make报错:
make[6]: Entering directory `/root/Download/vlc-1.1.5/modules/audio_filter/converter'
  CC     liba52tofloat32_plugin_la-a52tofloat32.lo
  CCLD   liba52tofloat32_plugin.la
/usr/bin/ld: /usr/lib/liba52.a(parse.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/liba52.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

(未完)

0

  • 评论加载中,请稍候...
发评论

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有