ubuntu 13.10编译安装mono环境(二)

2019-10-14 13:59:32于海丽

重新初始化libgdiplus安装配置文件:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ ./configure --prefix=/opt/mono-3.2.8
==============>省略了很多<==============
./configure: line 13371: test: too many arguments
configure: error: "Failed to compile with X11/Xlib.h include. You must fix your compiler paths"

提示错误,需要安装libx11-dev:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ sudo apt-get install libx11-dev

重新初始化libgdiplus安装配置文件:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ ./configure --prefix=/opt/mono-3.2.8
==============>省略了很多<==============
configure: error: Cairo requires at least one font backend.
Please install freetype and fontconfig, then try again:
http://freetype.org/ http://fontconfig.org/

configure: error: ./configure failed for cairo

需要安装freetype和fontconfig:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ sudo apt-get install libfreetype6-dev
nike@NIKE-PC:~/src/libgdiplus-2.10.9$ sudo apt-get install fontconfig
nike@NIKE-PC:~/src/libgdiplus-2.10.9$ sudo apt-get install libfontconfig1-dev

重新初始化libgdiplus安装配置文件:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ ./configure --prefix=/opt/mono-3.2.8
==============>省略了很多<==============
Configuration summary
 
* Installation prefix = /opt/mono-3.2.8
* Cairo = 1.6.4 (internal)
* Text = cairo
* EXIF tags = No. Get it from http://libexif.sourceforge.net/
* Codecs supported:
 
- TIFF: no (Get it from http://www.libtiff.org/)
- JPEG: no (Get it from http://freshmeat.net/projects/libjpeg)
- GIF: no (See http://sourceforge.net/projects/libgif)
- PNG: yes
 
NOTE: if any of the above say 'no' you may install the
corresponding development packages for them, rerun
autogen.sh to include them in the build.

nike@NIKE-PC:

./configure通过。

编译安装源代码

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ make
make all-recursive
make[1]: Entering directory `/home/nike/src/libgdiplus-2.10.9'
Making all in pixman
make[2]: Entering directory `/home/nike/src/libgdiplus-2.10.9/pixman'
make all-recursive
make[3]: Entering directory `/home/nike/src/libgdiplus-2.10.9/pixman'
Making all in pixman
make[4]: Entering directory `/home/nike/src/libgdiplus-2.10.9/pixman/pixman'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -Wall -fvisibility=hidden -MT pixman-access.lo -MD -MP -MF .deps/pixman-access.Tpo -c -o pixman-access.lo pixman-access.c
../libtool: line 852: X--tag=CC: command not found

遇到错误了,通过google搜索,可能是因为在项目目录下生成的libtool脚本中定义了$ECHO变量,但是在脚本文件ltmain.sh中,使用的却是$echo(生成的libtool版本太旧) 解决方法很简单export echo=echo即可:

nike@NIKE-PC:~/src/libgdiplus-2.10.9$ export echo=echo
nike@NIKE-PC:~/src/libgdiplus-2.10.9$ make
==============>省略了很多<==============
make[2]: Entering directory `/home/nike/src/libgdiplus-2.10.9/tests'
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -pthread -o testgdi testgdi.o ../src/libgdiplus.la -lpthread -lfontconfig
libtool: link: gcc -g -O2 -pthread -o .libs/testgdi testgdi.o ../src/.libs/libgdiplus.so -lpthread -lfontconfig -pthread -Wl,-rpath -Wl,/opt/mono-3.2.8/lib
/usr/bin/ld: testgdi.o: undefined reference to symbol 'g_print'
/lib/i386-linux-gnu/libglib-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [testgdi] Error 1
make[2]: Leaving directory `/home/nike/src/libgdiplus-2.10.9/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nike/src/libgdiplus-2.10.9'
make: *** [all] Error 2