vlc常见的编译方式主要有两种:1、cygwin; 2、mingw+msys;
下面主要介绍第一种(windows xp系统,win7系统出现的编译错误比较多,暂未研究)
一、cygwin的安装
cygwin安装过程中主要是要注意安装包的选择,以下为vlc编译过程中需要的安装包,安装过程中注意选择一下安装包,否则在编译过程中容易“粗线”错误;
作者使用的cygwin版本为Cygwin-new(20081208);
unzip
zip
Devel
autoconf
automake
binutils
cvs
gcc
gcc-core
gcc-g++
gcc-mingw
gcc-mingw-core
gcc-mingw-g++
gdb
gettext
gettext-devel
git
libiconv
libgcrypt-devel
libtool
make
mingw-runtime
nasm
patchutils
pkg-config
subversion
Editor
vim
Libs
expat
libgcrypt
Web
curl
wget
2、下载源码及相关库
源码下载地址:http://download.videolan.org/pub/videolan/vlc 、、各种版本,我选择的是1.1.10
第三方库:http://download.videolan.org/pub/testing/win32/ 、、vlc编译需要第三方库,相应的vlc版本要用相应的vlc第三方库,否则编译容易出现问题;
作者选择的源码及库:vlc-1.1.10.tar.bz2 + contrib-20110224-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2
vlc-1.1.10编译还需要lua库:http://www.lua.org/ftp/lua-5.1.4.tar.gz
3、编译过程
(1)启动cygwin
第一次运行Cygwin,产生如下文字表示启动成功,并且在根目录'/'下就会生成 “ /home/你的计算机名 ” 的文件夹:
Copying skeleton files.
These files are for the user to personalise
their cygwin experience.
These will never be overwritten.
`./.bashrc' -> `/home/wangwei1//.bashrc'
`./.bash_profile' -> `/home/wangwei1//.bash_profile'
`./.inputrc' -> `/home/wangwei1//.inputrc'
(2)安装lua
将vlc-1.1.10、第三方库和lua 三个压缩包拷贝至“ /home/你的计算机名 ”
在cygwin终端运行命令:tar xzvf lua-5.1.4.tar.gz
make ansi
make install
如果安装成功,运行luac会出现如下文字:
c:/cygwin_new/usr/local/bin/luac.exe: no input files given
usage: d:/cygwin_new/usr/local/bin/luac.exe [options] [filenames].
Available options are:
- process stdin
-l list
-o name output to file 'name' (default is "luac.out")
-p parse only
-s strip debug information
-v show version information
-- stop handling options
运行命令: tar xjvf vlc-1.1.10.tar.bz2
tar xjvf contrib-20110224-win32-bin-gcc-4.4.4-runtime-3.17-only.tar.bz2 -C /
(4) 进入vlc-1.1.10
cd vlc-1.1.10
执行命令 ./bootstrap
成功后会显示
PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin -Wl,--allow-multiple-definition" CXX="g++ -mno-cygwin" \
./configure \
--host=i686-pc-mingw32 \
--enable-nls --enable-sdl \
--enable-avcodec --enable-avformat --enable-swscale \
--enable-faad --enable-flac --enable-theora \
--enable-freetype \
--enable-fribidi \
--disable-fluidsynth \
--enable-live555 --with-live555-tree=/usr/win32/live.com \
--enable-caca \
--with-dvdnav-config-path=/usr/win32/bin \
--disable-vcdx --enable-goom \
--enable-twolame --enable-dvdread \
--enable-debug --enable-dca \
--disable-mkv --disable-taglib --disable-projectm \
--disable-zvbi --disable-schroedinger --disable-dirac \
--enable-mozilla --with-mozilla-sdk-path=/usr/win32/gecko-sdk \
--disable-upnp
--------------------
version : 1.1.5
system : mingw32
architecture : i686 mmx sse sse2
build flavour : debug devel
vlc aliases : cvlc rvlc svlc qvlc
plugins/bindings : activex mozilla
You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
(6)稍加修改
# cp $(top_srcdir)/projects/mozilla/npvlc.dll.manifest $(win32_destdir)/mozilla/
# cp $(top_srcdir)/projects/activex/axvlc.dll.manifest $(win32_destdir)/activex/