win7下使用cygwin編譯VLC

前幾天使用MinGW+msys編譯,錯誤百出
經過幾天調,改還是沒有成功,不是x264版本落後就是CACA版本落後
我猜想是msys的lib沒有及時更新導致的,
 
在各位的建議下使用cygwin編譯,由於本人麼有看無言的視頻 導致一些錯誤,另外一個由於是windows7系統也出現了一些 別人沒有遇到的錯誤
總結如下:
 
首先關於Cygwin 安裝以及卸載:
cygwin安裝使用了比較簡便的方法是無言博客的已經下載好的包然後使用本地安裝:
注意1:由於本人不仔細的原因在安裝的時候選擇了default選項,導致第一次bootstrap錯誤:
$ ./bootstrap && dos2unix ./configure-vlc01.sh && ./con
+ ACLOCAL_ARGS='-I m4 '
+ test -d extras/contrib/bin
++ uname -s
+ test .CYGWIN_NT-6.1 = .Darwin
+ pkg-config --version
+ PKGCONFIG=no
+ export AUTOPOINT
+ test ''
+ AUTOPOINT=autopoint
+ autopoint --dry-run --force
+ AUTOPOINT=true
+ echo
+ set +x
generating modules/**/Makefile.am
.......................................................
+ echo
+ echo
+ cp -f INSTALL INSTALL.git
+ autoreconf --install --force --verbose -I m4
./bootstrap: line 110: autoreconf: command not found
 
於是重裝Cygwin選擇keep 按照無言博客的pic選項選擇;
結果第二次bootstrap出現了折磨我一天的一個錯誤:
+ autoreconf --install --force --verbose -I m4
   8928 [main] perl 4540 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap C:\cygwin\li
b\perl5\5.10\i686-cygwin\auto\File\Glob\Glob.dll to same address as parent(0x910000) != 0x9F000
0
      8 [main] perl 4476 fork: child 4540 - died waiting for dll loading, errno 11
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
然後是一大堆perl 沒有fork成功的錯誤
ctrl+C 停止運行。找錯嘗試了以下幾種方法:
1:卸載重裝--這個過程也被折磨了:
卸載過程如下:
--千萬不要用setup的install卸載 否則 會產生不能不能卸載的一個ID 我深受次苦
具體步驟如下:
1.刪除安裝用的臨時文件夾(在cygwin裏輸入命令)(如果你沒設可以跳過這步,可以去c盤看看有沒有什麼文件夾是在安裝了cygwin之後產生的,一般那就是了)
$ rm -f /cygdrive/c/你的臨時文件夾
2.停止cron service(沒開啓此服務的可以跳過,我的默認就沒開啓)
$ cygrunsrv --stop cron
$ cygrunsrv --remove cron
3.停止並刪除inetd服務(我的默認也沒開啓)
$ net stop inetd
$/usr/sbin/inetd --remove-as-service
4.刪除安裝文件夾,默認是c:\cygwin
5.刪除桌面上的icon,和開始菜單裏的啓動文件夾
6.刪除註冊表裏的相關項
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions
7.刪除環境變量(PATH, CYGWIN)
環境變量PATH裏的c:\cygwin\bin; 還有名叫CYGWIN的變量
-------------------------
如果你在再次安裝 第一次運行之後沒有出現home 請將環境變量HOME刪除
 
我卸載只用了 4 5 6 7 好OK
 安裝的時候我選擇全部安裝 呵呵。。。。省事的方法 浪費空間
言歸正傳::::
爲了解決fork perl5這個錯誤我費盡心機:
1.關閉殺毒軟件--------問題依舊
2右鍵 管理員運行Cygwin--問題依然存在
3C盤空間不夠(剩下2.7G)-Cygwin安裝換到F盤(21G)---問題依然存在;;
 
再次Google 找到如下解決辦法。順利解決:
     1. shutdown all Cygwin processes and services
     2. start ash (do not use bash or rxvt)
     3. execute /bin/rebaseall (in the ash window)
 即:
1 關掉cygwin窗口
2運行-cmd 進去你安裝Cygwin的路徑下 執行/bin/ash
3然後$ /bin/rebaseall
 
終於解決fork問題:
下邊說一下整體安裝編譯過程:
1.安裝cygwin 注意:不要default  嚴格按照無言給出的pic選項選擇
  懶的話就inshtall all
2.按照完成後運行一次 初次運行會創建../home/usrname/文件夾
 
3下載源碼以及第三方庫 這裏省事了 我沒用去匹配直接用了
高人提示的去下載:
vlc-0.9.9a版本匹配的第三方庫——contrib-20090329-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2
vlc-0.9.9a.tar.bz2contrib-20090329-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2   w32api-3.11-1.tar.bz2qt4-4.4.1-win32-bin.tar.bz2拷貝到/home/username/下面(username爲登陸的用戶目錄),
 
運行以下命令解壓:
tar xjvf contrib-20090329-win32-bin-gcc-4.2.1-sjlj-runtime-3.13-only.tar.bz2 -C /
tar xjvf vlc-0.9.9a.tar.bz2
tar xjvf w32api-3.11-1.tar.bz2 -C /
tar xjvf qt4-4.4.1-win32-bin.tar.bz2
必須做一點點清理工作:
rm -rf /usr/win32/bin/moc
rm -rf /usr/win32/bin/rcc
rm -rf /usr/win32/bin/uic
 
這裏注意:如果手動刪除 只刪除moc rcc uic文件 保留其exe
4 ./bootstrap
 
執行以下
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 \
         --disable-zvbi
 
 
保存爲configure-vlc01.sh
 
然後將Makefile.am第694行
修改
cp "$(top_srcdir)/extras/package/win32/vlc.exe.manifest" "$(win32_destdir)/"
#  cp "$(top_srcdir)/extras/package/win32/vlc.exe.manifest" "$(win32_destdir)/"
 
Makefile.am第735行
修改
cp $(top_srcdir)/projects/activex/axvlc.dll.manifest $(win32_destdir)/activex/
#  cp $(top_srcdir)/projects/activex/axvlc.dll.manifest $(win32_destdir)/activex/
 
然後make 好
最後執行 make package-win32-base
搞定!
記以下我編譯過程出現的問題和解決辦法:
 
1錯誤一
make[5]: Entering directory `/home/kathy/vlc-0.9.9a/modules/gui/qt4'
/usr/win32/bin/moc -DHAVE_CONFIG_H -I../../../include -I../../../include -I/usr/win32/include -
I/usr/win32/include/ebml -DSYS_MINGW32 -I../../.. `top_builddir="../../.." ../../../vlc-config
--cppflags plugin qt4` -o main_interface.moc.cpp main_interface.hpp
/usr/win32/bin/moc: /usr/win32/bin/moc: cannot execute binary file
make[5]: *** [main_interface.moc.cpp] Error 126
make[5]: Leaving directory `/home/kathy/vlc-0.9.9a/modules/gui/qt4'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/kathy/vlc-0.9.9a/modules/gui'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/kathy/vlc-0.9.9a/modules/gui'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/kathy/vlc-0.9.9a/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kathy/vlc-0.9.9a'
make: *** [all] Error 2
 
可能出現的原因:
1 沒用下載w32api-3.11-1.tar.bz2和qt4-4.4.1-win32-bini.tar.bz2
2下載了也解壓了 但是沒有刪除moc rcc uic等三個文件
 
錯誤二:
出現諸多的
 
/usr/win32/lib/libzvbi.a(packet.o):packet.c:(.text+0x6dc0): undefined reference to `__imp__pthread_mutex_lock'
/usr/win32/lib/libzvbi.a(packet.o):packet.c:(.text+0x6dd3): undefined reference to `__imp__pthread_mutex_unlock'
/usr/win32/lib/libzvbi.a(caption.o):caption.c:(.text+0x9c): undefined reference to `__imp__pthread_mutex_lock'
/usr/win32/lib/libzvbi.a(caption.o):caption.c:(.text+0x10a): undefined reference to `__imp__pthread_mutex_unlock'
/usr/win32/lib/libzvbi.a(caption.o):caption.c:(.text+0x171): undefined reference to `__imp__pthread_mutex_destroy'
/usr/win32/lib/libzvbi.a(caption.o):caption.c:(.text+0x54b): undefined reference to `__imp__pthread_mutex_init'
/usr/win32/lib/libzvbi.a(caption.o):caption.c:(.text+0xd58): undefined reference to `__imp__pthread_mutex_unlock'
 沒有定義
請在configure-vlc10.sh裏面添加
         --disable-zvbi
 
 
 
 
 
遇到的問題N多呵呵 先這些吧
很感謝
 
 

 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章