参考:1.windows平台下VLC2.0.5编译 http://blog.csdn.net/shen8686/article/details/8533058
2.官网编译:http://wiki.videolan.org/Win32CompileMSYSNew
1.解压工具 7-zip
Accept Post Install: [y] MinGW Installed? [y] path to MinGW: [c:/MinGW]
URL: http://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/wget-1.11.4-1-setup.exe/download
解压到c:\MinGW
需要注意的是第一个链接需要下载最新版本,目前测试通过最新版本是glib 2.28, non-dev版本
添加PKG配置路径变量
在C:\MSys\1.0\msys.bat添加,据wangyong0921翻译,可以直接运行msys.bat,然后输入下面的语句
set PKG_CONFIG_PATH=/win32/lib/pkgconfig 加到msys.bat里的第一行
VLC采用LUA脚本语言,我们需要先编译LUA工具
URL:http://www.lua.org/ftp/lua-5.1.4.tar.gz
解压到home文件夹(C:\MSys\1.0\home\<username>)
运行Msys并执行下列指令
cd /home/<username>/lua-5.1.4 make mingw make install
VLC源代码
好吧,终于要进入正题了。。
Git
-------------------------
打开Git,下载contrib
git clone git://git.videolan.org/vlc.git
获取预编译contrib
------------------------
cd vlc/contrib mkdir win32 && cd win32 ../bootstrap --build=i586-mingw32msvc make prebuilt
tar: i586-mingw32msvc/lib/libdts.a: Cannot create symlink to `/home/jb/vlc/contrib/i586-mingw32msvc/lib/libdca.a': No such file or directory tar: Error exit delayed from previous errors make: *** [prebuilt] Error 2
mv i586-mingw32msvc .. //实际不用mv 直接cd 就行了 cd ../i586-mingw32msvc change_prefix.sh
sed:invalid option --i
echo "Fixing up $file"
sed -i.orig -e "s,$old_prefix,$new_prefix,g" $file
rm -f $file.orig
echo "Fixing up $file" # sed -i.orig -e "s,$old_prefix,$new_prefix,g" $file sed -e "s,$old_prefix,$new_prefix,g" $file>$(file).new mv $file.new $file rm -f $file.new
mv: cannot move `./change_prefix.sh.tmp' to `./change_prefix.sh': Permission denied
echo '<username>' echo administrator
old: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2> /dev/null || hostname`", [host which ran configure]) new: AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
cd vlc cp -v /usr/share/aclocal/* m4/ bootstrap
autom4te-2.68:failed to run /bin/m4: Bad file number aclocal: /usr/bin/autom4t3-2.68 failed with exit status: 1 autoreconf: failed to run aclocal: Bad file number
dos2unix configure.ac
sh extras/package/win32/configure.sh --host=i586-pc-mingw32msvc --disable-nls
sh extras/package/win32/configure.sh --host=i586-pc-mingw32msvc --disable-nls --enable-debug //这样会出现live555错误
sh extras/package/win32/configure.sh --with-contrib=contrib/i586-mingw32msvc --disable-nls --enable-debug //OK
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
--disable-lua
PATH=/usr/win32/bin:$PATH make
make package-win32-base
make package-win32-zip
make package-win32
make package-win32-base-debug
make: *** No rule to make target `package-win32-base'. Stop.
“/libFLAC.a(bitwriter.o):bitwriter.c:(.text+0x3fb): undefined refer
ence to `_ntohl@4'
这是由于contrib里面的某个库没有链接ws2_32库导致的
根据错误信息,发现是\vlc\win32\modules\codec这个文件夹下发生的
打开该文件夹下的 Makefile 文件,搜索“-lFLAC”
找到两处地方
FLAC_LIBS = -Le:/tianminProject/VLC/vlc/contrib/mingw32/lib -lFLAC -lm -logg -lws2_32
LIBS_flac = -Le:/tianminProject/VLC/vlc/contrib/mingw32/lib -lFLAC -lm -logg -lws2_32
分别在末尾 添加 -lws2_32 ,链接 ws2_32 库
svn:从collab.net.下载
makensis: 按照下面修改makefile文件
# Create package # if makensis -VERSION >/dev/null 2>&1; then \ # MAKENSIS="makensis"; \ # elif [ -x "/cygdrive/c/Program Files/NSIS/makensis" ]; then \ # MAKENSIS="/cygdrive/c/Program\ Files/NSIS/makensis"; \ # elif [ -x "$(PROGRAMFILES)/NSIS/makensis" ]; then \ # MAKENSIS="$(PROGRAMFILES)/NSIS/makensis"; \ # elif wine --version >/dev/null 2>&1; then \ # MAKENSIS="wine C:/Program\ Files/NSIS/makensis.exe"; \ # else \ # echo 'Error: cannot locate makensis tool'; exit 1; \ # fi; \ # eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \ # eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"
source: C:\msys\1.0\home\<username>\vlc\contrib\i586-mingw32msvc\moc.exe
target: C:\msys\1.0\bin\moc.exe