首先下載libgdiplus2.10.9安裝包
wget http://download.mono-PRoject.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2tar -jxvf libgdiplus-2.10.9.tar.bz2cd libgdiplus-2.10.9
進(jìn)入目錄開始configure編譯
./configure --prefix=/usrmake
將libgdiplus安裝在/usr目錄下
發(fā)現(xiàn)在該操作系統(tǒng)報(bào)錯(cuò)了:如下
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 1make[2]: Leaving directory `/root/libgdiplus-2.10/src'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/root/libgdiplus-2.10'make: *** [all] Error 2root@ubuntu:~/libgdiplus-2.10# sudo ln -s /usr/X11/include/freetype2/freetype/ /usr/X11/include/freetypeln: failed to create symbolic link ‘/usr/X11/include/freetype’: No such file or directory
這個(gè)錯(cuò)誤就是說(shuō)創(chuàng)建/usr/X11/include/freetype鏈接失敗了,因?yàn)檎也坏絝reetype
我們打開/usr/include看有沒(méi)有freetype這個(gè)目錄,沒(méi)有吧,但是我們找到了freetype2,這樣我們做個(gè)鏈接吧
ln -s /usr/include/freetype2 /usr/include/freetype
然后繼續(xù)make發(fā)現(xiàn)錯(cuò)誤如下:
/usr/lib64/libglib-2.0.so.0: could not read symbols: Invalid Operationcollect2: error: ld returned 1 exit statusmake[2]: *** [testgdi] Error 1make[2]: Leaving directory `/usr/local/src/libgdiplus-2.10.9/tests'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/usr/local/src/libgdiplus-2.10.9'make: *** [all] Error 2
解決方法來(lái)自:http://beginor.github.io/2013/10/15/install-and-config-mono-on-ubuntu-server.html
先執(zhí)行 ./configure 命令, 然后編輯libgdiplus-2.10.9目錄下的 tests/Makefile 文件;將 130 行的 LIBS = -lpthread -lfontconfig 改為 LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11;再次執(zhí)行 make 命令即可。
再次make,是不是很快成功了,ok,makeinstall吧
新聞熱點(diǎn)
疑難解答
圖片精選