Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12297395
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: 系统运维

2011-04-10 00:56:24

首先是创建VLC的编译环境。

到下载相关文件。

下载或者更高的版本,然后运行,按照提示安装,最好选择安装full版本。

下载或者更高的版本,然后运行,按照提示安装,中间要正确填写已经安装好的MinGW的目录,例如“j:/MinGW”。主要要用“/”。

下载或者更高的版本,然后运行,按照提示安装。

其次是编译VLC。

下载 到某个目录,如“j:\vlc”。

到下载文件到上述目录。

运行msys程序,在弹出的控制终端中输入

mkdir /vlc

然后用windows的记事本编辑器编辑msys\1.0\etc\fstab文件,在里面加入一行 j:/VLC /vlc,这样可以挂载vlc目录。

在msys的控制终端中输入

cd /vlc

tar jxvf contrib-0.8.6e-gcc-3.4.5-only.tar.bz2 –C /

会把解码库解压到/usr/win32-branch目录中。

在当前目录继续输入

tar zxvf vlc-0.8.6e.tar.gz

将vlc的源代码解压缩到vlc-0.8.6e目录中。

在当前目录继续输入

  cd vlc-0.8.6e

  ./bootstrap

  PKG_CONFIG_PATH=/usr/win32-branch/lib/pkgconfig \

  CPPFLAGS="-I/usr/win32-branch/include -I/usr/win32-branch/include/ebml" \

  LDFLAGS=-L/usr/win32-branch/lib \

  ./configure \

      --disable-gtk \

      --enable-nls --enable-sdl --with-sdl-config-path=/usr/win32-branch/bin \

      --enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \

      --with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \

      --with-wx-config-path=/usr/win32-branch/bin \

      --with-freetype-config-path=/usr/win32-branch/bin \

      --with-fribidi-config-path=/usr/win32-branch/bin \

      --enable-caca --with-caca-config-path=/usr/win32-branch/bin \

      --with-xml2-config-path=/usr/win32-branch/bin \

      --with-dvdnav-config-path=/usr/win32-branch/bin \

      --disable-cddax --disable-vcdx --enable-goom \

      --enable-twolame --enable-dvdread \

      --disable-mkv \

      --enable-debug

开始VLC的配置,然后执行

make

开始编译。编译过程中先出现如下错误:

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:113: error: syntax error before "off_t"

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:118: error: syntax error before '}' token

make[4]: *** [libaccess_output_file_plugin_a-file.o] Error 1

make[4]: Leaving directory `/vlc/vlc-0.8.6e/modules/access_output'

make[3]: *** [all-modules] Error 1

make[3]: Leaving directory `/vlc/vlc-0.8.6e/modules/access_output'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/vlc/vlc-0.8.6e/modules'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

原因是:没有在sys/stat.h之前包含“config.h”文件。这2个头文件有冲突。

解决办法:将vlc-0.8.6e /modules/access_out/file.c和vlc-0.8.6e /modules/access_out/udp.c这两个文件的“#include ”注释掉。

继续编译,又同样出类似问题

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:113: error: syntax error before "off_t"

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/stat.h:118: error: syntax error before '}' token

make[6]: *** [libmux_ps_plugin_a-pes.o] Error 1

make[6]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux/mpeg'

make[5]: *** [all-modules] Error 1

make[5]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux/mpeg'

make[4]: *** [all-recursive] Error 1

make[4]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/vlc/vlc-0.8.6e/modules/mux'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/vlc/vlc-0.8.6e/modules'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

解决办法:将vlc-0.8.6e\modules\mux\mpeg\pes.c文件的“#include ”注释掉。

继续编译,还是有问题

j:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/wchar.h:419: error: `off_t' does not name a type

make[3]: *** [libaxvlc_a-main.o] Error 1

make[3]: Leaving directory `/vlc/vlc-0.8.6e/activex'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/vlc/vlc-0.8.6e/activex'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/vlc/vlc-0.8.6e'

make: *** [all] Error 2

原因:off_t类型没有定义。

解决办法:在MinGW/include/wchar.h文件中加入如下代码:

#ifndef _OFF_T_DEFINED

typedef long off_t;

#define _OFF_T_DEFINED

#endif

继续编译,可以通过,并在vlc-0.8.6e目录下面生成vlc.exe可执行文件,这就是可以用于windows下的VLC了。通过实验,编译成功的文件可以播放*.mpg、*.mp3等格式的多媒体文件以及接收播放网络流媒体。

阅读(5832) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~