歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> RedHat Linux 9.0 下編譯MPlayer-1.0rc3

RedHat Linux 9.0 下編譯MPlayer-1.0rc3

日期:2017/2/28 16:14:02   编辑:Linux教程
一.資料准備 1.主程序:MPlayer-1.0rc3 2.Codecs:essential-20071007.tar.bz2 3.Wincodecs:windows-essential-20071007.zip 4.皮膚:KDE-0.3.tar.bz2 二.安裝過程 編碼包要安裝在/usr/lib/codecs和/usr/lib/wincodecs目錄下,所以先要新建文件夾。(也可以在編譯過程中指定特定的文件夾)

1.安裝源碼包

# mkdir /usr/lib/codecs

# mkdir /usr/lib/wincodecs

#tar jxvf essential-20071007.tar.bz2

# unzip windows-essential-20071007.zip

# mv essential-20071007/* /usr/lib/codecs

# mv windows-essential-20071007/* /usr/lib/wincodecs

2.編譯安裝MPlayer

# tar jxvf MPlayer-1.0rc1.tar.bz2

# cd mplayer-1.0pre1

# ./configure --prefix=/usr/local/ --enable-gui --enable-freetype --codecsdir=/usr/lib/codecs/ --win32codecsdir=/usr/lib/wincodecs/ --language=zh_CN

接下來繼續

# make

在這裡會出錯

/usr/include/netinet/in.h:259: parse error before '(' token /usr/include/netinet/in.h:259: parse error before "__u32" /usr/include/netinet/in.h:260: parse error before '(' token /usr/include/netinet/in.h:260: parse error before "__u16" /usr/include/netinet/in.h:262: parse error before '(' token /usr/include/netinet/in.h:262: parse error before "__u32" /usr/include/netinet/in.h:264: parse error before '(' token /usr/include/netinet/in.h:264: parse error before "__u16" stream_dvd.c: In function `dvd_parse_chapter_range': stream_dvd.c:168: warning: passing arg 2 of `strtol' from incompatible pointer type make[1]: *** [stream_dvd.o] Error 1 make[1]: Leaving directory `/home/monde/MPlayer-1.0rc2/stream' make: *** [stream/stream.a] Error 2

解決方法如下(原因可能是Mplayer 不識別函數 ntohl,btohs,htonl 等)

編輯/usr/include/netinet/in.h文件

[root@localhost MPlayer-1.0rc3]# vi /usr/include/netinet/in.h

在__BEGIN_DECLS下面添加如下代碼:

#undef ntohl

#undef ntohs

#undef htonl

#undef htons

執行make clean,再執行make,就可以了

# make install

Copyright © Linux教程網 All Rights Reserved