首先下载libgdiplus2.10.9安装包
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar.bz2
tar -jxvf libgdiplus-2.10..tar.bz2
cd libgdiplus-2.10.
进入目录开始configure编译
./configure --prefix=/usr
make
将libgdiplus安装在/usr目录下
发现在该操作系统报错了:如下
gdiplus-private.h::: fatal error: freetype/tttables.h: No such file or directory
#include <freetype/tttables.h>
^
compilation terminated.
make[]: *** [adjustablearrowcap.lo] Error
make[]: Leaving directory `/root/libgdiplus-2.10/src'
make[]: *** [all-recursive] Error
make[]: Leaving directory `/root/libgdiplus-2.10'
make: *** [all] Error
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.: could not read symbols: Invalid operation
collect2: error: ld returned exit status
make[]: *** [testgdi] Error
make[]: Leaving directory `/usr/local/src/libgdiplus-2.10./tests'
make[]: *** [all-recursive] Error
make[]: Leaving directory `/usr/local/src/libgdiplus-2.10.'
make: *** [all] Error
解决方法来自:http://beginor.github.io/2013/10/15/install-and-config-mono-on-ubuntu-server.html
先执行 ./configure 命令, 然后编辑libgdiplus-2.10.目录下的 tests/Makefile 文件;
将 行的 LIBS = -lpthread -lfontconfig 改为 LIBS = -lpthread -lfontconfig -lglib-2.0 -lX11;
再次执行 make 命令即可。
再次make,是不是很快成功了,ok,make install吧