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找不到

和上一步一樣就是拷貝了一個


發佈了36 篇原創文章 · 獲贊 17 · 訪問量 18萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章