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 root@ubuntu:~/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 命令, 然後編輯 test/Makefile 文件; 將 130 行的 LIBS = -lpthread -lfontconfig 改為 LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11; 再次執行 make 命令即可。
再次make,是不是很快成功了,ok,make install吧
更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2
Ubuntu 14.04 下載、安裝、配置的相關知識 http://www.linuxidc.com/Linux/2014-04/100370.htm
Ubuntu 14.04系統下載地址:http://www.linuxidc.com/Linux/2014-04/100352.htm
Windows 7下硬盤安裝Ubuntu 14.04圖文教程 http://www.linuxidc.com/Linux/2014-04/100369.htm