安裝glib-2.44.1
先說清楚,這是一篇糾結文,正確答案請看這里
糾結開始了:
下載https://github.com/GNOME/glib
參考https://developer.gnome.org/glib/2.44/
要用到autoconf生成配置腳本
先使用apt-get install autoconf安裝autoconf,這個稍微有點慢。
然后在glib-master目錄下運行
autoconf configure.ac
報錯了
configure.ac:66: error: possibly undefined macro: AM_INIT_AUTOMAKEIf this token and others are legitimate, please use m4_pattern_allow.See the Autoconf documentation.
這個問題還沒解決,又遇到一個新的問題,就是我把glib-master在虛擬機的共享文件夾中解壓然后拷貝到ubuntu的根目錄下之后,
glib-master下會自動出現一個configure文件,我按照安裝文檔說的運行./configure又提示bash: ./configure: No such file or directory
然后我用ls -l 列出目錄和文件的詳細信息,卻發現列表中根本沒有configure這個文件
真實詭異啊!!!!
即便是我要刪除這個文件,也會提示no such file or directory,但是這個文件依然赤裸裸的在我的文件列表中。
先不管這個,網上有人說試試安裝libtool
apt-get install libtool
網速是硬傷....
終于裝好了,然后autoconf,這回沒有報錯。
然后ls -l能看到configure這個文件了
繼續 ./configure
又報錯
./configure: line 2607: syntax error near unexpected token `1.11'./configure: line 2607: `AM_INIT_AUTOMAKE(1.11 -Wno-portability no-define no-dist-gzip dist-xz tar-ustar)'
試試autoreconf -i
又報錯
Makefile.am: error: required file './README' not foundparallel-tests: installing './test-driver'automake: error: cannot open < gtk-doc.make: No such file or directoryautoreconf: automake failed with exit status: 1
忽略這個錯誤,再試試
autoreconf -fi
依然報錯
Makefile.am: error: required file './README' not foundautomake: error: cannot open < gtk-doc.make: No such file or directoryautoreconf: automake failed with exit status: 1
繼續裝作沒看見,運行
./configure
報錯如下:
checking for LIBFFI... noconfigure: error: Package requirements (libffi >= 3.0.0) were not met:
No package 'libffi' found
Consider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard PRefix.
Alternatively, you may set the environment variables LIBFFI_CFLAGSand LIBFFI_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details.
裝個libffi先
wget ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz
tar zxvf libffi-3.0.11.tar.gz
cd libffi-3.0.11/
./configure
make
make install
然后再重新回到glib-master目錄運行
./configure
對了,我自己建了一個空的文件README,不知道有啥影響,先放著。
這次輸出好長,給我造成了一種大功告成的錯覺,可是最后還是有一行錯誤
error: cannot find input file: `Makefile.in'
想繼續發揚裝沒看見的優良傳統,直接
make
不料壓根找不到make文件,算了,從頭來過
我估計是安裝包有問題,從這里http://ftp.gnome.org/pub/gnome/sources/glib/2.44/glib-2.44.1.tar.xz下載新的安裝包
這次不放根目錄了,放在usr目錄下
然后tar xvJf glib-2.44.1.tar.xz解壓
然后
cd glib-2.44.1
./configure
我了個大去,竟然沒有報錯,我之前都干了神馬!!!
趕緊的
make
然后
make install
看著一行行的輸出,真的好爽,最后來張圖
新聞熱點
疑難解答
圖片精選