CentOS7安装libgdiplus(处理Drawing生成验证码图片的问题)

场景:CentOS7运行.Core的验证码接口出现System.Drawing的问题(然后查看说要安装libgdiplus,其他版本碰到make出错问题)

1:环境依赖

操作系统为CentOS7.0,先安装mono依赖的各种组件:

yum -y install gcc gcc-c++ bison pkgconfig glib2-devel gettext make libpng-devel libjpeg-devel libtiff-devel libexif-devel giflib-devel libX11-devel freetype-devel fontconfig-devel  cairo-devel

2.下载并安装libgdiplus, libgdiplus是一个Mono库,用于对非Windows操作系统提供GDI+兼容的API。各版本的下载地址:http://download.mono-project.com/sources/libgdiplus/

事先安装【libgdiplus-devel】

yum install libgdiplus-devel

cd /tmp
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-4.2.tar.gz
tar zxf libgdiplus-4.2.tar.gz
cd libgdiplus-4.2
./configure --prefix=/usr/mono/
make
make install
echo "/usr/mono/lib" > /etc/ld.so.conf.d/mono.conf

到这里就成了(以下从原著:https://www.shuzhiduo.com/A/Vx5ME0m5Nr/)

注:项目包引用改成【ZKWeb.System.Drawing】

 

 

3:下载并安装mono,各版本的下载地址:http://download.mono-project.com/sources/mono/

cd /tmp
wget  http://download.mono-project.com/sources/mono/mono-4.6.0.125.tar.bz2
tar jxf mono-4.6.0.125.tar.bz2
cd mono-
./configure --prefix=/usr/mono/
make -j2
make install
echo  PATH=/usr/mono/bin:$PATH>>~/.bash_profile
source ~/.bash_profile
ldconfig

4:查看mono版本:

mono --version

 

原版:https://www.shuzhiduo.com/A/Vx5ME0m5Nr/

 

posted @ 2022-03-19 18:25  蜗牛的礼物  阅读(460)  评论(0编辑  收藏  举报