ubuntu13.10上交叉编译win32运行的vlc2.0.3总结

最近做交叉编译真是做的死去活来,不过 最后还是成功了,在此总结一下。

一、安装交叉编译环境

1. sudo apt-get install gcc-mingw-w64-i686 g++-mingw-w64
2. sudo apt-get install mingw-w64

// 下载安装对应自己vlc版本的包,要不会报错,这一步至关重要,我一开始就没找到vlc2.0.3对应的包,结果悲剧了好几天,我这里是编译的vlc2.0.3,用的是mingw-w64-dev_2.0.3-1_all.deb和mingw-w64-i686-dev_2.0.3-1_all.deb,请各位根据下边网址找寻自己的对应版本,也可以直接在windows上下载然后弄进linux去执行4和6。
4. sudo dpkg -i mingw-w64-dev_2.0.3-1_all.deb
6. sudo dpkg -i mingw-w64-i686-dev_2.0.3-1_all.deb


二、下载安装工具包

// vlc 依赖包
1. sudo apt-get build-dep vlc

// 用于打包
2. sudo apt-get install subversion p7zip-full nsis

三、下载配置vlc
1.在window下下载vlc2.0.3
http://download.videolan.org/pub/videolan/vlc/2.0.3/在这个网站下载vlc-2.0.3.tar.xz,你要是想编译其他也可以下载其他版本,不过要注意第一大步里环境配置版本对应。下载完拷入linux。
//另外可以通过在linux下输入git clone git://git.videolan.org/vlc.git来获取最新版本的vlc,最新版本vlc对应的环境也应该是最新的,即在第一大步就下载最新的就可以了。

// 使用第三方包
2.    cd /路径/vlc2.0.3   进入vlc2.0.3目录然后执行如下操作
     $ mkdir -p contrib/win32
       $ cd contrib/win32
       $ ../bootstrap --host= i686-w64-mingw32
//直接make prebuilt是使用最新的第三方包,在执行这步之前我执行的是在windows下载点击打开链接vlc-contrib-i686-w64-mingw32-20120402.tar.bz2,然后拷贝到上边linux所创建的contrib/win32下,把vlc-contrib-i686-w64-mingw32-20120402.tar.bz2改名为
vlc-contrib-i686-w64-mingw32-latest.tar.bz2再执行make prebuilt。
       $ make prebuilt


   // 下载编译qt时间会很长,下载可以从  http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.tar.gz  下载完后,请手动复制到 contrib/tarballs, 并重名为 qt-4.8.2.tar.gz 这样可以大大节省 下载时间,编译时间只能靠你的CPU了
      $  make .qt4 

四、配置编译VLC
1. 回到 vlc 根目录
   cd  {vlcroot}
   ./bootstrap
   mkdir win32 && cd win32
   
   // 使用默认配置
      ../extras/package/win32/configure.sh --host=i686-w64-mingw32

若此处出错:

configure: error: libgcryptnot found. Install libgcrypt or use --disable-libgcrypt. Have a nice day.

解决方法见最后总结第2步。


   // 如果正常的话,应该不会出错,这时这时的你.... 请 make 一下吧
   make
//make时出现libqt4_plugin_la-dialogs_provider.lo的错误,进入vlc-2.0.3/include,gedit vlc_windows_interfaces.h,在第37行#include<objbase.h>后加上#undef small

  // 然后打包
   make package-win32
   会生成一个 7z 的包和一个 安装 exe 包


遇到主要问题总结:

1.版本问题:一定要注意找对应自己vlc版本的工具,不然没戏。

2.若出现libcrypt not found的错误,就要安装libcrypt,全部安装完若还是出现这个问题就把第三步2和第四步1做的删掉再重来这两步。

libgcrypt依赖于libgpg-error。首先下载libgpg-error和libgcrypt。

需要到ftp://ftp.gnupg.org/gcrypt/libgpg-error/下载目前最新版本 libgpg-error-1.17.tar.gz,若有更高版本,请自行下载

到ftp://ftp.gnupg.org/gcrypt/libgcrypt/下载目前最新版本libgcrypt-1.6.2.tar.gz, 若有更高版本,请自行下载

在linux下安装:点击打开链接        点击打开链接     这是最新版本libgpg-error和libgcrypt-1.6.2安装方法的链接。

网址为:http://www.linuxfromscratch.org/blfs/view/svn/general/libgpg-error.html

和http://www.linuxfromscratch.org/blfs/view/svn/general/libgcrypt.html

libgpg-error-1.17安装:

复制代码
Install libgpg-error by running the following commands:

./configure --prefix=/usr --disable-static &&
make
To test the results, issue: make check.

Now, as the root user:

make install &&
install -v -m644 -D README /usr/share/doc/libgpg-error-1.17/README
复制代码

 libgcrypt-1.6.2安装(实验中执行了红字部分):

复制代码
Install libgcrypt by running the following commands:

./configure --prefix=/usr &&
make
Only info documentation is shipped in the package tarball. If you wish to build alternate formats of the documentation, (you must have texlive-20130530 installed to build the PDF and PostScript documentation), then issue the following commands:

make -C doc pdf ps html &&
makeinfo --html --no-split -o doc/gcrypt_nochunks.html doc/gcrypt.texi &&
makeinfo --plaintext       -o doc/gcrypt.txt           doc/gcrypt.texi
To test the results, issue: make check.

Now, as the root user:

make install &&
install -v -dm755   /usr/share/doc/libgcrypt-1.6.2 &&
install -v -m644    README doc/{README.apichanges,fips*,libgcrypt*} \
                    /usr/share/doc/libgcrypt-1.6.2
If you built the additional documentation, install it by issuing the following commands as the root user:

install -v -dm755   /usr/share/doc/libgcrypt-1.6.2/html &&
install -v -m644 doc/gcrypt.html/* \
                    /usr/share/doc/libgcrypt-1.6.2/html &&
install -v -m644 doc/gcrypt_nochunks.html \
                    /usr/share/doc/libgcrypt-1.6.2 &&
install -v -m644 doc/gcrypt.{pdf,ps,dvi,txt,texi} \
                    /usr/share/doc/libgcrypt-1.6.2
复制代码


3.出现错误libqt4_plugin_la-dialogs_provider.lo

解决方法:把../extras/package/win32/configure.sh --host=i686-w64-mingw32 改为

../extras/package/win32/configure.sh --host=i686-w64-mingw32 --disable-qt4 --disable-skins2

4.moc:无法执行二进制文件的错误

rcc:无法执行二进制文件的错误

uic:无法执行二进制文件的错误

解决方法:根据提示找到moc所在位置,然后删除moc、rcc和uic,不要删除moc.exe、rcc.exe和uic.exe。然后重新执行第四大步。

5.stdole2.idl错误

sudo apt-get install wine-dev 或者是sudo apt-get install wine1.4-dev

6.npvlc.dll.manifest找不到

我自己拷贝了一个进去,拷贝的是win32下vlc源码里的

7.test.html找不到

和上一步一样就是拷贝了一个


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值