1. 程式人生 > >Ubuntu Server(Ubuntu 14.04 LTS 64位)安裝libgdiplus2.10.9出錯問題記錄

Ubuntu Server(Ubuntu 14.04 LTS 64位)安裝libgdiplus2.10.9出錯問題記錄

首先下載libgdiplus2.10.9安裝包

wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
tar -jxvf libgdiplus-2.10.9.tar.bz2
cd libgdiplus-2.10.9

進入目錄開始configure編譯

./configure --prefix=/usr
make

將libgdiplus安裝在/usr目錄下

發現在該作業系統報錯了:如下

gdiplus-private.h:33:31: fatal error: freetype/tttables.h: No such file or directory
 #include 
<freetype/tttables.h> ^ compilation terminated. make[2]: *** [adjustablearrowcap.lo] Error 1 make[2]: Leaving directory `/root/libgdiplus-2.10/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/libgdiplus-2.10' make: *** [all] Error 2 [email protected]
:
~/libgdiplus-2.10# sudo ln -s /usr/X11/include/freetype2/freetype/ /usr/X11/include/freetype ln: failed to create symbolic link ‘/usr/X11/include/freetype’: No such file or directory

這個錯誤就是說建立/usr/X11/include/freetype連結失敗了,因為找不到freetype

我們開啟/usr/include看有沒有freetype這個目錄,沒有吧,但是我們找到了freetype2,這樣我們做個連結吧

ln -s /usr/include/freetype2 /usr/include/freetype

然後繼續make發現錯誤如下:

/usr/lib64/libglib-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [testgdi] Error 1
make[2]: Leaving directory `/usr/local/src/libgdiplus-2.10.9/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libgdiplus-2.10.9'
make: *** [all] Error 2

解決方法來自:http://beginor.github.io/2013/10/15/install-and-config-mono-on-ubuntu-server.html

先執行 ./configure 命令, 然後編輯libgdiplus-2.10.9目錄下的 tests/Makefile 檔案;
將 130 行的 LIBS = -lpthread -lfontconfig 改為 LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11;
再次執行 make 命令即可。

再次make,是不是很快成功了,ok,make install吧