一、环境准备1.操作系统ubuntu14.04.1LTS2.安装以下插件[需要联网]$sudoapt-getinstall-ygcc-mingw-w64-i686g++-mingw-w64-i686mingw-w64-tools$sudoapt-getinstall-ylua5.2libtoolautomakeautoconfautopointmakegettext$sudoapt-getinstall-yqt4-dev-toolsqt5-default$sudoapt-getinstall-ygitsubversioncmakecvswine-devyasm$sudoapt-getinstall-yzipp7zipnsisbzip2$sudoapt-getbuild-depvlc3.执行以下脚本move.sh,将部分dll移走备份#!/bin/sh#Thisscriptenforcesstaticallylinkingoflibgcc,libstdc++-6,andlibpthread,#withoutneedingtorebuildgccandmingw-w64fromscratch.#-static-libgcc-static-libstdc++flagscannotbeusedinalibtoolbuildsystem,#aslibtoolremovesflagsthatitdoesn'tunderstand.move(){[-f$1]||return1mkdir-pold/mv-v$*old/return0}forxini686x86_64dolibrary_path_list=`$x-w64-mingw32-gcc-v/dev/null2&1|grep^LIBRARY_PATH|cut-d=-f2|sort|uniq`IFS=':'foriin$library_path_listdocd$imovelibstdc++-6.dlllibstdc++.dll.alibgcc_s.alibgcc_s_sjlj-1.dll&&ln-slibgcc_eh.alibgcc_s.amovelibpthread.dll.alibwinpthread.dll.amovelibwinpthread-1.dll[-d../bin]&&cd../bin&&movelibwinpthread-1.dlldonedoneexit0二、下载vlc2.1.2安装包1.下载软件包1)找到vlc-contrib-i686-w64-mingw32-20150630.tar.bz2下载2)下载vlc2.1.2版本三、编译安装1.将下载vlc-2.2.1.tar.xz的包放在/home目录下2.执行命令$cd/home$tarxJvfvlc-2.2.1.tar.xz$cdvlc-2.2.1/$cdcontrib/$mkdirwin32;cdwin323.将下载的vlc-contrib-i686-w64-mingw32-20150630.tar.bz2放在/home/vlc-2.1.2/contrib/win32下面,执行命令$mvvlc-contrib-i686-w64-mingw32-20150630.tar.bz2vlc-contrib-i686-w64-mingw32-latest.tar.bz24.编译库$../bootstrap--host=i686-w64-mingw32$makeprebuilt5.编译源码$cd../../$./bootstrap6.指定pkg_config路径$exportPKG_CONFIG_LIBDIR=/home/vlc-2.1.2/contrib/i686-w64-mingw32/lib/pkgconfig7.再执行一下命令$mkdirwin32;cdwin32$../extras/package/win32/configure.sh--host=i686-w64-mingw328.修改Makefile文件1)找到stamp-npapi-fetch修改如下2)找到package-win-common:package-win-install,屏蔽对npapi-vlc的操作这时候可以执行编译了$make9.打包$makepackage-win-common10.执行完成后,当前目录下会生成vlc-2.2.1目录,里面包含有dll以及相关sdk目录.