From: http://blog.csdn.net/guanshangming/article/details/5581270
转自:http://jeremiah.blog.51cto.com/539865/114190
Jeremiah刚刚工作几个月,参与的第一个项目是与视频监控有关,分配给我的任务就是用开源的vlc做一个自己的播放器。
对于开源项目来说,搭建起编译环境是第一步也是最重要的一步。Jeremiah在历经5天的痛苦折磨,google出了n多网页,其中还包括一个德语的网页和韩语的网页,终于编译通过了vlc0.8.6d。百度到的ChinaUnix的一个网页上面说:编译vlc感觉就像被...,Jeremiah深有体会啊。不过编译成功,还是小兴奋了一下。啊哈哈~!有些自虐倾向。
在网上查到一个vlc的qq群:49846130。里面人快满了,不知道什么时候开个二群。有兴趣的可以加一下,大家共同交流。
废话不多说了,步入正题。
在windows下编译vlc需要使用仿真Linux环境Cygwin或者Msys+MingW,据说差不多。但是Jeremiah没有用过后者,所以在这只介绍Cygwin环境。
编译之前的说明:由于最近Cygwin更新了库文件,导致出现了一些新的无法通过编译的错误。Jeremiah将自己的应用的Cygwin-old的库文件在我的公共邮箱提供了下载,具体下载方式为:
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
编译第一步:去下载Cygwin。给个网址:[url]http://www.cygwin.com/setup.exe[/url](用我上面提供的,选择从本地安装)
编译第二步:安装Cygwin。Cygwin需要安装到某个盘的根路径。然后要找个源下载相应的库,[url]http://www.cygwin.cn/pub[/url]相对比较快, [url]ftp://ftp.sjtu.edu.cn/cygwin/[/url]作为参考。(如果用的本地的库文件,就不用写这一项)然后就需要安装其他库来支持vlc的编译了。目录如下:
Archive
unzip (5.52-2)
zip (2.32-2)
Devel
autoconf (4-1 2.13-3 2.61-1)
automake (2-1 1.10-1 1.4p6-4 1.5-2 1.63-3 1.7.9-3 1.8.5-3 1.9.6-2)
binutils (20080624)
cvs (1.11.22-1)
gcc (3.4.4-3)
gcc-core (3.4.4-3)
gcc-g++ (3.4.4-3)
gcc-mingw (20040810-1)
gcc-mingw-core (20050522-1)
gcc-mingw-g++ (20050522-1)
gdb (6.8-2)
gettext (0.15-1)
gettext-devel (0.15-1)
git (1.6.0.2-1)
libiconv (1.11-1)
libgcrypt-devel (1.41-4)
libtool (1.5.27a-1)
make (3.81-2)
mingw-runtime (3.15.1-1)
nasm (2.02-1)
patchutils (0.2.31-2)
pkg-config (0.23a-2)
subversion (1.5.2-1)
Editor
vim (7.2-3)
Libs
expat (2.0.1-1)
libgcrypt (1.4.1-4)
Web
curl (optional: for building extras/contrib) (7.16.3-1)
wget (optional: for building extras/contrib) (1.11.3-1)
unzip (5.52-2)
zip (2.32-2)
Devel
autoconf (4-1 2.13-3 2.61-1)
automake (2-1 1.10-1 1.4p6-4 1.5-2 1.63-3 1.7.9-3 1.8.5-3 1.9.6-2)
binutils (20080624)
cvs (1.11.22-1)
gcc (3.4.4-3)
gcc-core (3.4.4-3)
gcc-g++ (3.4.4-3)
gcc-mingw (20040810-1)
gcc-mingw-core (20050522-1)
gcc-mingw-g++ (20050522-1)
gdb (6.8-2)
gettext (0.15-1)
gettext-devel (0.15-1)
git (1.6.0.2-1)
libiconv (1.11-1)
libgcrypt-devel (1.41-4)
libtool (1.5.27a-1)
make (3.81-2)
mingw-runtime (3.15.1-1)
nasm (2.02-1)
patchutils (0.2.31-2)
pkg-config (0.23a-2)
subversion (1.5.2-1)
Editor
vim (7.2-3)
Libs
expat (2.0.1-1)
libgcrypt (1.4.1-4)
Web
curl (optional: for building extras/contrib) (7.16.3-1)
wget (optional: for building extras/contrib) (1.11.3-1)
经过比较漫长的下载过程,Cygwin就算安装好了。建议将下载下来的文件(位于安装文件同目录)保留下来,下次安装的时候直接从文件安装就不用到网上下载了。
第一次运行Cygwin,如果没有产生下列代码:
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'
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'
则表示windows用户没有添加到Cygwin中,运行以下两条命令添加用户:
mkpasswd -l [-d] > /etc/passwd
mkgroup -l [-d] > /etc/group
mkgroup -l [-d] > /etc/group
其中-d可选,如果你在域中,需要用加入'-d 域名'。
重新开启Cygwin,在根目录'/'下就会生成/home/yourname的文件夹。
编译第三步:下载源码及第三方库。vlc的所有的源码(*.tar.gz,*.tar.bz2)及编译好的绿色版(win32/*.zip),安装版(win32/*.exe)都可以在这里下载:[url]http://download.videolan.org/pub/videolan/vlc/[/url]。Cygwin下编译vlc最关键的就是源码和第三方库要相匹配,Jeremiah之所以编译了5天,经历了n多痛苦的过程,就是因为没有匹配好源码和第三方库,导致了大量的错误。上面网址里面的vlc的版本很多,相对稳定的是vlc-0.8.6*版本,推荐0.8.6i,匹配的contrib为:[url]http://download.videolan.org/pub/testing/win32/contrib-20070530-win32-bin-gcc-3.4.5-only.tar.bz2[/url]。Jeremiah写这篇博客的时候最新的发行版是vlc-0.9.6,其实1.0.0已经在测试了,只是没有正式发布而已([url]http://nightlies.videolan.org/[/url]),vlc各个版本的更新日志参考:[url]http://www.videolan.org/developers/vlc/NEWS[/url]。但是Jeremiah没有编译成功vlc-0.9.6,0.9.*版本推荐0.9.4,匹配的contib为:contrib-20080811-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2。
Jeremiah将在未来几篇博客中详细介绍编译0.8.6i和0.9.4。
windows平台下vlc编译之二:vlc-0.8.6i的编译
如果按照上一篇博客《windows平台下vlc编译之一:编译环境构建》安装好了Cygwin,下载了源码和第三方库之后,我们就可以编译vlc了。这篇博客先讲如何编译vlc-0.8.6i.
步骤一:解压源码和第三方库。
源文件:http://download.videolan.org/pub/videolan/vlc/0.8.6i/vlc-0.8.6i.tar.gz
库:http://download.videolan.org/pub/testing/win32/contrib-20070530-win32-bin-gcc-3.4.5-only.tar.bz2
将vlc-0.8.6i.tar.gz和contrib-20070530-win32-bin-gcc-3.4.5-only.tar.bz2拷贝到/home/username/下面(username为登陆的用户目录),运行以下命令解压:
tar xjvf contrib-20070530-win32-bin-gcc-3.4.5-only.tar.bz2 -C /
tar xzvf vlc-0.8.6i.tar.gz
tar xzvf vlc-0.8.6i.tar.gz
做一点点清理工作
rm -rf /usr/win32/bin/moc
rm -rf /usr/win32/bin/rcc
rm -rf /usr/win32/bin/uic
rm -rf /usr/win32/bin/rcc
rm -rf /usr/win32/bin/uic
步骤二:Bootstrap
cd vlc-0.8.6i
./bootstrap
./bootstrap
可能出现的错误:
+ aclocal-1.9 -I m4
/usr/bin/m4:configure.ac:4643: cannot create temporary file for diversion: Permission denied
/usr/bin/m4:configure.ac:4643: cannot create temporary file for diversion: Permission denied
autom4te-2.61: /usr/bin/m4 failed with exit status: 1
aclocal-1.9: autom4te failed with exit status: 1
aclocal-1.9: autom4te failed with exit status: 1
分析:杀毒软件有关系,比如Jeremiah用的Mcafee就会出这样的错误。
解决方法:关闭杀毒软件重新运行./bootstrap。
步骤三:编辑vlc脚本
在vic-0.8.6i下新建文本文件"configure-vlc01.sh"(见附件),内容如下:
PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig /
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" /
LDFLAGS=-L/usr/win32/lib /
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" /
./configure /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac /
--with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-shared-libvlc /
--enable-debug
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" /
LDFLAGS=-L/usr/win32/lib /
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" /
./configure /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac /
--with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-shared-libvlc /
--enable-debug
想知道每个--enable,--disable是什么意思,可以使用如下命令将configure的参数信息保存到confHelp.txt中,以后对照该文件查看修改vlc编译脚本。
./configure -h > confHelp.txt
步骤四:运行vlc脚本
转换下脚本的编码格式:
dos2unix configure-vlc01.sh
运行脚本:
./configure-vlc01.sh
如果脚本遇到了类似Permission denied的错误,提升脚本的权限:
chmod 777 configure-vlc01.sh
如果脚本运行成功,则会显示如下信息:
vlc configuration
--------------------
vlc version : 0.8.6i
system : mingw32
architecture : i686 mmx
build flavour : debug optim devel
vlc aliases : svlc wxvlc
You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
--------------------
vlc version : 0.8.6i
system : mingw32
architecture : i686 mmx
build flavour : debug optim devel
vlc aliases : svlc wxvlc
You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.
步骤五:作一点点修改工作
由于在编译完成后vlc.exe会要求libvlc.dll.exe,这显然是不对的。应该直接去调用libtool.dll,解决方案为:
修改"/tmp/vlc-0.8.6i"目录下的libtool文件4760行
prog)
case $host in
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
为:
prog)
case $host in
#*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
*cygwin*) output=`$echo $output` ;;
esac
步骤六:make
运行:
make
如果是双核的电脑,可以运行:
make -j2
如果的电脑有N多个cpu,则参数可以为-jN,N为cpu个数。这样能将几个cpu都利用起来,执行时间会缩短一些。
make的执行期间可能会出现错误,需要修改一些文件,当修改完成后,再执行make,以前make的东西会保留而继续make刚才出错的地方。其实这种方式很方便我们以后修改源代码,重新make的时候它只会编译修改的地方,很节省时间。
错误1:
In file included from file.c:30:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/sys/stat.
h:113: error: parse error before "off_t"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/sys/stat.
h:118: error: parse error before '}' token
make[4]: *** [libaccess_output_file_plugin_a-file.o] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/access_output'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/access_output'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/sys/stat.
h:113: error: parse error before "off_t"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/sys/stat.
h:118: error: parse error before '}' token
make[4]: *** [libaccess_output_file_plugin_a-file.o] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/access_output'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/access_output'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
解决方案:
//在"/usr/i686-pc-mingw32/include/sys"目录下的stat.h的文件开始处添加如下代码
#ifndef _OFF_T DEFINED
typedef long off_t;
#define _OFF_T DEFINED
#endif
#ifndef _OFF_T DEFINED
typedef long off_t;
#define _OFF_T DEFINED
#endif
错误2:
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
Open':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:219: und
efined reference to `_dca_init'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
DoWork':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:303: und
efined reference to `_dca_syncinfo'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:312: und
efined reference to `_dca_frame'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:331: und
efined reference to `_dca_blocks_num'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:335: und
efined reference to `_dca_block'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:341: und
efined reference to `_dca_samples'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:331: und
efined reference to `_dca_blocks_num'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
Destroy':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:376: und
efined reference to `_dca_free'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
CloseFilter':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:430: und
efined reference to `_dca_free'
collect2: ld returned 1 exit status
make[6]: *** [libdtstofloat32_plugin.dll] Error 1
make[6]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter/conve
rter'
make[5]: *** [all-modules] Error 1
make[5]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter/conve
rter'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
Open':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:219: und
efined reference to `_dca_init'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
DoWork':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:303: und
efined reference to `_dca_syncinfo'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:312: und
efined reference to `_dca_frame'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:331: und
efined reference to `_dca_blocks_num'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:335: und
efined reference to `_dca_block'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:341: und
efined reference to `_dca_samples'
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:331: und
efined reference to `_dca_blocks_num'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
Destroy':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:376: und
efined reference to `_dca_free'
libdtstofloat32_plugin.a(libdtstofloat32_plugin_a-dtstofloat32.o): In function `
CloseFilter':
/home/wangwei1/vlc-0.8.6i/modules/audio_filter/converter/dtstofloat32.c:430: und
efined reference to `_dca_free'
collect2: ld returned 1 exit status
make[6]: *** [libdtstofloat32_plugin.dll] Error 1
make[6]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter/conve
rter'
make[5]: *** [all-modules] Error 1
make[5]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter/conve
rter'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/audio_filter'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
解决方案:
修改"/tmp/vlc-0.8.6i"目录下的vlc-config 文件
dtstofloat32)
ldflags="${ldflags} -ldts_pic"
为:
dtstofloat32)
ldflags="${ldflags} -ldts"
dtstofloat32)
ldflags="${ldflags} -ldts_pic"
为:
dtstofloat32)
ldflags="${ldflags} -ldts"
错误3:
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x3fb): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x488): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x4e5): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x57f): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x5d5): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x66f): more undefined
references to `_ntohl@4' follow
collect2: ld returned 1 exit status
make[4]: *** [libflacdec_plugin.dll] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/codec'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/codec'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x488): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x4e5): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x57f): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x5d5): undefined refer
ence to `_ntohl@4'
/usr/win32/lib/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x66f): more undefined
references to `_ntohl@4' follow
collect2: ld returned 1 exit status
make[4]: *** [libflacdec_plugin.dll] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/codec'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules/codec'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
解决方案:
修改"/tmp/vlc-0.8.6i"目录下的vlc-config 文件
flacdec)
ldflags="${ldflags} -lFLAC"
为:
flacdec)
ldflags="${ldflags} -lFLAC -lws2_32"
flacdec)
ldflags="${ldflags} -lFLAC"
为:
flacdec)
ldflags="${ldflags} -lFLAC -lws2_32"
错误4:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/wchar.h:4
27: error: `off_t' does not name a type
make[3]: *** [libaxvlc_a-main.o] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/activex'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/activex'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
27: error: `off_t' does not name a type
make[3]: *** [libaxvlc_a-main.o] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.8.6i/activex'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/wangwei1/vlc-0.8.6i/activex'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.8.6i'
make: *** [all] Error 2
解决方案:
//在"/usr/i686-pc-mingw32/include/"目录下的wchar.h的文件开始处添加如下代码
#ifndef _OFF_T DEFINED
typedef long off_t;
#define _OFF_T DEFINED
#endif
#ifndef _OFF_T DEFINED
typedef long off_t;
#define _OFF_T DEFINED
#endif
一般会遇到这四个错误,如果还出现了其他错误,肯定是哪一步搞错了,如果还是有错误,RPWT。
步骤七:打包
执行以下命令就会得到绿色版的vlc:
make package-win32-base
在vlc-0.8.6i的目录下又会出现一个目录vlc-0.8.6i,里面就是编译好的vlc了。
如果执行:
make package-win32-zip
得到的zip文件就是官网上提供的/win32/*.zip文件了。
如果想得到安装文件(后面讲ActiveX的时候会用到),首先需要下载NSIS 2.41,给个连接:[url]http://prdownloads.sourceforge.net/nsis/nsis-2.41-setup.exe?download[/url]。
安装NSIS 2.41,然后在打包好的vlc-0.8.6i下面右键vlc.win32.nsi,选择Compile NSIS .。
期间会出错误,有关Mozilla插件的:
Error in macro InstallFile . macroline 1
Error in . "E:/cygwin/home/wangwei1/vlc-0.8.6i0/vlc-0.8.6i/vlc.win32.nsi" . line 445 -- aborting creation process
Error in . "E:/cygwin/home/wangwei1/vlc-0.8.6i0/vlc-0.8.6i/vlc.win32.nsi" . line 445 -- aborting creation process
用文本编译器打开vlc.win32.nsi,在第445行前加上;(分号)注释起来。
; !insertmacro InstallFile mozilla/npvlc.dll
重新Compile NSIS .。运行成功之后,在编译好的vlc-0.8.6i同级目录里面就会出现vlc-${VERSION}-win32.exe这个文件。这个就是自己编译的vlc的安装文件了。(文件名应该是vlc-0.8.6i-win32.exe,但是可能NSIS的脚本的问题,${VERSION}替换不了,手动改一下就行了。)
2009-07-09更新:
vlc.win32.nsi的第7行加入
!define VERSION "0.8.6i"
可以解决${VERSION}的问题。
至此,vlc-0.8.6i算是编译完成了。
2010-04-09更新:
错误修正:
如果运行vlc出现了“Windows无法访问指定设备...您可能没有合适权限访问”,或者“Permission denied”错误,请在打包好的vlc-0.8.6i目录下执行以下命令。增加两个文件的运行权限。
- chmod 755 vlc.exe vlc.exe.manifest
windows平台下vlc编译之三:vlc-0.9.4的编译
如果你已经成功编译了vlc-0.8.6i,那么编译vlc-0.9.4就跟玩似的。
在这简单的介绍下编译过程。如果有什么不明白的,先好好看看前两篇日志。
1. 解压源码及库文件。
注意:如果你编译过vlc-0.8.6i,请先执行以下命令删除以前的库文件。
rm -rf /usr/win32
还是在Windows下直接用rar解压源文件吧,用tar xzvf来解压最后可能会出现exe的执行权限问题。
源文件:http://download.videolan.org/pub/videolan/vlc/0.9.4/vlc-0.9.4.tar.bz2,解压到X:/cygwin/home/yourname下。
第三方库:contrib-20080811-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2,解压到X:/cygwin/下。
(
在我的公共邮箱提供了下载,具体下载方式为:
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
)
2. 解压完库文件做一点点清理工作
rm -rf /usr/win32/bin/moc
rm -rf /usr/win32/bin/rcc
rm -rf /usr/win32/bin/uic
rm -rf /usr/win32/bin/rcc
rm -rf /usr/win32/bin/uic
3. 解压完源码做一点点修改工作
用文本编辑器或vi打开vlc-0.9.4/configure.ac,
修改
AM_GNU_GETTEXT_VERSION([0.17])
为
AM_GNU_GETTEXT_VERSION([0.15])
AM_GNU_GETTEXT_VERSION([0.17])
为
AM_GNU_GETTEXT_VERSION([0.15])
或运行
sed -i 's/AM_GNU_GETTEXT_VERSION(0.17)/AM_GNU_GETTEXT_VERSION(0.15)/g' configure.ac
4. 执行bootstrap,注意杀毒软件可能引起会Permission Denied。
./bootstrap
5. 显示Successfully bootstrapped后就可以编辑vlc脚本了。
这里有个问题需要详细的说明一下,vlc官方提供的第三方库qt4有问题,相关的skins2不好用。如果禁用掉qt4和skins2,最后得到的vlc没有界面,可以在命令行下面运行。保存以下脚本为configure-vlc01.sh(见附件)。(如果想解决qt4的问题,得到有界面的vlc,请直接看8)
PATH=/usr/win32/bin:$PATH /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--disable-qt4 --disable-skins2 /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
运行以下命令运行脚本:
dos2unix configure-vlc01.sh
./configure-vlc01.sh
./configure-vlc01.sh
6. make
make
[or make -j2]
[or make -j2]
Jeremiah在make的时候没有遇到错误,如果你遇到错误,请把错误直接贴到google上搜索解决方法。
7. 打包,根据自己的需求来吧。
make package-win32-base
make package-win32-zip
关于如何制作vlc的安装文件,看上一篇日志吧。(基本上报错就是一些language的错误或者skins、npvlc.dll的错误,原则就是哪行出错了,就用;(分号)把哪行注释起来。)
8. 解决下qt4的问题。
先把以下脚本保存为configure-vlc02.vlc(见附件)。
PATH=/usr/win32/bin:$PATH /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--with-wx-config-path=/usr/win32/bin /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
类似于5.执行脚本,可能会出现以下问题:
/usr/win32/include/qt4/QtCore/qatomic_windows.h:394: error: previous declaration
`long int InterlockedIncrement(long int*)' here
make[6]: *** [libqt4_plugin_la-qt4.lo] Error 1
make[6]: Leaving directory `/cygdrive/c/vlc/modules/gui/qt4'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/cygdrive/c/vlc/modules/gui/qt4'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/cygdrive/c/vlc/modules/gui'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/cygdrive/c/vlc/modules/gui'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/cygdrive/c/vlc/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/c/vlc'
make: *** [all] Error 2
`long int InterlockedIncrement(long int*)' here
make[6]: *** [libqt4_plugin_la-qt4.lo] Error 1
make[6]: Leaving directory `/cygdrive/c/vlc/modules/gui/qt4'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/cygdrive/c/vlc/modules/gui/qt4'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/cygdrive/c/vlc/modules/gui'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/cygdrive/c/vlc/modules/gui'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/cygdrive/c/vlc/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/c/vlc'
make: *** [all] Error 2
需要去下载两个文件:
1. [url]http://linux.rz.ruhr-uni-bochum.de/download/cygwin/release-2/w32api/w32api-3.11-1.tar.bz2[/url]
2. [url]http://downloads.videolan.org/pub/videolan/vlc/0.8.5/contrib/qt4-4.4.1-win32-bin.tar.bz2[/url]
运行解压命令解压这两个包。
tar xjvf w32api-3.11-1.tar.bz2 -C /
tar xjvf qt4-4.4.1-win32-bin.tar.bz2
继续执行make,报错如下:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/ld: cannot fi
nd -lqjpeg
collect2: ld returned 1 exit status
make[6]: *** [libqt4_plugin.la] Error 1
make[6]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui/qt4'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui/qt4'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.9.4'
make: *** [all] Error 2
nd -lqjpeg
collect2: ld returned 1 exit status
make[6]: *** [libqt4_plugin.la] Error 1
make[6]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui/qt4'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui/qt4'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules/gui'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/wangwei1/vlc-0.9.4/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.9.4'
make: *** [all] Error 2
将刚才解压得到的qt4目录下面的lib/libqjpeg.a拷贝到/usr/win32/lib中。进入到qt4-4.4.1-win32-bin目录中执行:
cp lib/libqjpeg.a /usr/win32/lib
再进入到vlc-0.9.4中执行make,应该就没有错误了。然后可以按照7.打包了。
windows平台下vlc编译之四:精简vlc
vlc太大,组件太多,我们根据业务需求,能用的仅仅是几个组件而已,其他不用的我们就该去掉。这里Jeremiah根据自己的情况精简了vlc,vlc-0.9.4最后得到的安装文件3518KB,cab文件3520KB;vlc-0.8.6i的安装文件3087KB,cab文件3264KB。相对于原来几十兆来说,小了N多。
1. 业务需求。
Jeremiah所用的业务需求是:(1)播放本地avi文件。(2)播放ts封装的rtp流。(3)播放rtsp流。
2. vlc-0.9.4的精简
脚本configure-vlc03.sh(见附件)如下:
PATH=/usr/win32/bin:$PATH /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-avcodec /
--enable-avformat /
--enable-libmpeg2 /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--disable-nls /
--disable-skins2 /
--disable-qt4 /
--disable-macosx-defaults /
--disable-hal /
--disable-dbus /
--disable-dbus-control /
--disable-telepathy /
--disable-mmx /
--disable-sse /
--disable-altivec /
--disable-coverage /
--disable-release /
--enable-sout /
--disable-lua /
--disable-httpd /
--disable-libproxy /
--disable-audioscrobbler /
--disable-taglib /
--disable-dvdnav /
--disable-dshow /
--disable-bda /
--disable-smb /
--disable-dvbpsi /
--disable-v4l2 /
--disable-libcdio /
--disable-libcddb /
--disable-vcdx /
--disable-cdda /
--disable-vcd /
--disable-dvb /
--disable-screen /
--disable-ogg /
--disable-mkv /
--disable-mod /
--disable-mpc /
--disable-gme /
--disable-mad /
--disable-id3tag /
--disable-swscale /
--disable-imgresample /
--disable-faad /
--disable-real /
--disable-realrtsp /
--disable-libtar /
--disable-a52 /
--disable-dca /
--disable-flac /
--disable-vorbis /
--disable-tremor /
--disable-speex /
--disable-tarkin /
--disable-theora /
--disable-dirac /
--disable-schroedinger /
--disable-png /
--disable-zvbi /
--disable-telx /
--disable-cmml /
--disable-kate /
--disable-x11 /
--disable-xvideo /
--disable-glx /
--disable-xinerama /
--disable-opengl /
--disable-sdl /
--disable-sdl-image /
--disable-freetype /
--disable-fribidi /
--disable-fontconfig /
--disable-libxml2 /
--disable-pulse /
--disable-alsa /
--disable-upnp /
--disable-ncurses /
--disable-visual /
--disable-atmo /
--disable-bonjour /
--disable-libgcrypt /
--disable-gnutls /
--disable-remoteosd /
--enable-shared=yes /
--enable-x264 /
--enable-vlc /
--enable-activex /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--disable-gtk /
--enable-avcodec /
--enable-avformat /
--enable-libmpeg2 /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--disable-nls /
--disable-skins2 /
--disable-qt4 /
--disable-macosx-defaults /
--disable-hal /
--disable-dbus /
--disable-dbus-control /
--disable-telepathy /
--disable-mmx /
--disable-sse /
--disable-altivec /
--disable-coverage /
--disable-release /
--enable-sout /
--disable-lua /
--disable-httpd /
--disable-libproxy /
--disable-audioscrobbler /
--disable-taglib /
--disable-dvdnav /
--disable-dshow /
--disable-bda /
--disable-smb /
--disable-dvbpsi /
--disable-v4l2 /
--disable-libcdio /
--disable-libcddb /
--disable-vcdx /
--disable-cdda /
--disable-vcd /
--disable-dvb /
--disable-screen /
--disable-ogg /
--disable-mkv /
--disable-mod /
--disable-mpc /
--disable-gme /
--disable-mad /
--disable-id3tag /
--disable-swscale /
--disable-imgresample /
--disable-faad /
--disable-real /
--disable-realrtsp /
--disable-libtar /
--disable-a52 /
--disable-dca /
--disable-flac /
--disable-vorbis /
--disable-tremor /
--disable-speex /
--disable-tarkin /
--disable-theora /
--disable-dirac /
--disable-schroedinger /
--disable-png /
--disable-zvbi /
--disable-telx /
--disable-cmml /
--disable-kate /
--disable-x11 /
--disable-xvideo /
--disable-glx /
--disable-xinerama /
--disable-opengl /
--disable-sdl /
--disable-sdl-image /
--disable-freetype /
--disable-fribidi /
--disable-fontconfig /
--disable-libxml2 /
--disable-pulse /
--disable-alsa /
--disable-upnp /
--disable-ncurses /
--disable-visual /
--disable-atmo /
--disable-bonjour /
--disable-libgcrypt /
--disable-gnutls /
--disable-remoteosd /
--enable-shared=yes /
--enable-x264 /
--enable-vlc /
--enable-activex /
脚本请参考:
./configure -h
以及:[url]http://www.jbkempf.com/blog/post/2007/12/14/Configure-step-in-VLC-building[/url]
make通过只后,删除locale文件夹,这个文件夹是用本地语言作界面的。删除plugins中的200多dll,只保留:
libaccess_file_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavcodec_plugin.dll
libavformat_plugin.dll
libavi_plugin.dll
libconverter_fixed_plugin.dll
libconverter_float_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavcodec_plugin.dll
libavformat_plugin.dll
libavi_plugin.dll
libconverter_fixed_plugin.dll
libconverter_float_plugin.dll
libhotkeys_plugin.dll
liblive555_plugin.dll
libmpeg_audio_plugin.dll
libpacketizer_copy_plugin.dll
libpacketizer_h264_plugin.dll
libpacketizer_vc1_plugin.dll
libplaylist_plugin.dll
librc_plugin.dll
librtp_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libugly_resampler_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
liblive555_plugin.dll
libmpeg_audio_plugin.dll
libpacketizer_copy_plugin.dll
libpacketizer_h264_plugin.dll
libpacketizer_vc1_plugin.dll
libplaylist_plugin.dll
librc_plugin.dll
librtp_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libugly_resampler_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
再用.nsi脚本编译,修改n个错误之后就生成了较小的安装文件了。
3. 精简vlc-0.8.6i
脚本configure-vlc02.sh(见附件)如下:
PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig /
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" /
LDFLAGS=-L/usr/win32/lib /
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" /
./configure /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac /
--with-ffmpeg-zlib /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--disable-nls /
--disable-cddax /
--disable-vcdx /
--disable-skins2 /
--disable-wxwidgets /
--disable-mozilla /
--disable-httpd /
--disable-dvdnav /
--disable-libcdio /
--disable-libcddb /
--disable-cdda /
--disable-sdl /
--disable-sdl-image /
--disable-vcd /
--disable-dvdread /
--disable-smb /
--disable-cmml /
--disable-alsa /
--disable-opengl /
--disable-png /
--disable-screen /
--disable-mkv /
--disable-mod /
--disable-mpc /
--disable-libtar /
--disable-speex /
--disable-visual /
--disable-daap /
--disable-bonjour /
--disable-gnutls /
--disable-vorbis /
--disable-dts /
--disable-real /
--disable-xml /
--disable-x264 /
--enable-sout /
--enable-activex /
--enable-shared-libvlc /
--enable-release
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" /
LDFLAGS=-L/usr/win32/lib /
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" /
./configure /
--with-freetype-config-path=/usr/win32/bin /
--with-fribidi-config-path=/usr/win32/bin /
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac /
--with-ffmpeg-zlib /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--disable-nls /
--disable-cddax /
--disable-vcdx /
--disable-skins2 /
--disable-wxwidgets /
--disable-mozilla /
--disable-httpd /
--disable-dvdnav /
--disable-libcdio /
--disable-libcddb /
--disable-cdda /
--disable-sdl /
--disable-sdl-image /
--disable-vcd /
--disable-dvdread /
--disable-smb /
--disable-cmml /
--disable-alsa /
--disable-opengl /
--disable-png /
--disable-screen /
--disable-mkv /
--disable-mod /
--disable-mpc /
--disable-libtar /
--disable-speex /
--disable-visual /
--disable-daap /
--disable-bonjour /
--disable-gnutls /
--disable-vorbis /
--disable-dts /
--disable-real /
--disable-xml /
--disable-x264 /
--enable-sout /
--enable-activex /
--enable-shared-libvlc /
--enable-release
make之后删除http,locale,skins,osdmenu文件夹,plugins保留:
libaccess_file_plugin.dll
libaccess_udp_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavi_plugin.dll
libffmpeg_plugin.dll
libfloat32tos16_plugin.dll
libfloat32_mixer_plugin.dll
libipv4_plugin.dll
libmpeg_audio_plugin.dll
libmpgatofixed32_plugin.dll
librc_plugin.dll
libs16tofixed32_plugin.dll
libs16tofloat32swab_plugin.dll
libs16tofloat32_plugin.dll
libs8tofloat32_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libu8tofixed32_plugin.dll
libu8tofloat32_plugin.dll
libugly_resampler_plugin.dll
libvobsub_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
libaccess_udp_plugin.dll
libaout_directx_plugin.dll
libasf_plugin.dll
libaudio_format_plugin.dll
libavi_plugin.dll
libffmpeg_plugin.dll
libfloat32tos16_plugin.dll
libfloat32_mixer_plugin.dll
libipv4_plugin.dll
libmpeg_audio_plugin.dll
libmpgatofixed32_plugin.dll
librc_plugin.dll
libs16tofixed32_plugin.dll
libs16tofloat32swab_plugin.dll
libs16tofloat32_plugin.dll
libs8tofloat32_plugin.dll
libsubtitle_plugin.dll
libtrivial_channel_mixer_plugin.dll
libtrivial_mixer_plugin.dll
libts_plugin.dll
libu8tofixed32_plugin.dll
libu8tofloat32_plugin.dll
libugly_resampler_plugin.dll
libvobsub_plugin.dll
libvout_directx_plugin.dll
libwaveout_plugin.dll
使用.nsi脚本来做安装文件就ok了。
windows平台下vlc编译之五:vlc-0.9.6的编译
前两天Jeremiah偶尔用最新的Cygwin编译了下vlc-0.9.6,好像修改一个错误就编译通过了,很简单,在这大体写一下。
1. 安装最新的Cygwin,图片见附件(pic.rar)。(如何卸载Cygwin或者使用双Cygwin,请看下一篇日志:《Cygwin的卸载与新旧双版本运行》)
Cygwin下载:[url]http://www.cygwin.com/setup.exe[/url]。选择通过网络安装。
强烈建议通过Jeremiah提供的本地文件安装:
Cygwin-new(20081208)在我的公共邮箱提供了下载,具体下载方式为:
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
1). 登录http://mail.qq.com
2). 用户名:jeremiah_vlc
3). 密码:发邮件给我(jeremiah.vlc@gmail.com),我会告知。
4). 在“我的文件夹”的“Jeremiah_VLC相关资源”有所有资料的超大附件连接。
Archive
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
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. 下载源码和库:
源码:[url]http://download.videolan.org/pub/videolan/vlc/0.9.6/vlc-0.9.6.tar.bz2[/url]
库:http://www.namipan.com/downfile/contrib-20081021-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2/7691f26e0285d472e5642666e3c6cbf94d2bd21d7032ea01
3. 解压源文件到e:/cygwin/home/yourname/。解压库到e:/cygwin/。
删除E:/cygwin/usr/win32/bin/的moc,rcc,uic。
修改vlc-0.9.6/configure.ac,
修改
AM_GNU_GETTEXT_VERSION([0.17])
为
AM_GNU_GETTEXT_VERSION([0.15])
AM_GNU_GETTEXT_VERSION([0.17])
为
AM_GNU_GETTEXT_VERSION([0.15])
或运行
sed -i 's/AM_GNU_GETTEXT_VERSION(0.17)/AM_GNU_GETTEXT_VERSION(0.15)/g' configure.ac
4. 保存脚本configure-vlc01.sh(见附件)。
PATH=/usr/win32/bin:$PATH /
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
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" CXX="g++ -mno-cygwin" /
./configure /
--host=i686-pc-mingw32 /
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin /
--enable-avcodec --enable-avformat --enable-swscale /
--enable-faad --enable-flac --enable-theora /
--enable-live555 --with-live555-tree=/usr/win32/live.com /
--enable-caca --with-caca-config-path=/usr/win32/bin /
--with-xml2-config-path=/usr/win32/bin /
--with-dvdnav-config-path=/usr/win32/bin /
--disable-cddax --disable-vcdx --enable-goom /
--enable-twolame --enable-dvdread /
--enable-debug --enable-dca /
--disable-mkv --disable-taglib
5. 运行./bootstrap && dos2unix ./configure-vlc01.sh && ./configure-vlc01.sh && make。
6. 出错:
_la-vlm.o input/.libs/libvlccore_la-vlmshell.o misc/.libs/libvlccore_la-revision
.o | | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]/([^ ]*/)//1 DATA/;/^.*[ ]__nm__
/s/^.*[ ]__nm__/([^ ]*/)[ ][^ ]*//1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //' | sort |
uniq > .libs/libvlccore.exp'
make[4]: *** [libvlccore.la] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.9.6'
make: *** [all] Error 2
.o | | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]/([^ ]*/)//1 DATA/;/^.*[ ]__nm__
/s/^.*[ ]__nm__/([^ ]*/)[ ][^ ]*//1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //' | sort |
uniq > .libs/libvlccore.exp'
make[4]: *** [libvlccore.la] Error 1
make[4]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/wangwei1/vlc-0.9.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wangwei1/vlc-0.9.6'
make: *** [all] Error 2
打开libtool第144行:
修改
global_symbol_pipe=""
为
global_symbol_pipe="sed -n -e 's/^.*[ ]//([ABCDGIRSTW][ABCDGIRSTW]*//)[ ][ ]*//(//)//([_A-Za-z][_A-Za-z0-9]*//)/$///1//2//3 //3/p'"
global_symbol_pipe=""
为
global_symbol_pipe="sed -n -e 's/^.*[ ]//([ABCDGIRSTW][ABCDGIRSTW]*//)[ ][ ]*//(//)//([_A-Za-z][_A-Za-z0-9]*//)/$///1//2//3 //3/p'"
继续make && make package-win32-base。