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 命令, 然后編輯libgdiplus-2.10.9目錄下的 tests/Makefile 文件;
將 130 行的 LIBS = -lpthread -lfontconfig 改為 LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11;
再次執行 make 命令即可。

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM