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吧

posted @ 2014-06-28 01:41  逆水寒龙  阅读(5212)  评论(7编辑  收藏  举报