unbuntu arm64 导出文件报错“The type initializer for 'Gdip' threw an exception”

现场环境是Ubuntu arm64的离线环境,不同于上一篇的解决方案,由于离线很多指令执行不了,需要安装li bgdiplus,只能通过下载离线安装包去解决。

1.安装包下载地址:https://packages.ubuntu.com/impish/arm64/libgdiplus

粘贴图片

2.下载完成后将压缩包上传到 /usr/lib  或者/usr 下,这里应该没什么讲究,然后进行解压   tar -xzvf file.tar.gz (解压tar.gz)

3、解压成功后跳转到文件夹下  cd   /usr/lib / libgdiplus-6.0.4+dfsg

 粘贴图片

4.给configure权限   chmod -R 777  configure

5.执行 ./configure    执行过程中发现报错了,是缺少devel造成

 

configure: error: Package requirements (cairo >= 1.6.4) were not met:
 
Package 'cairo', required by 'virtual:world', not found
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
 
Alternatively, you may set the environment variables CAIRO_CFLAGS
and CAIRO_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解决:依次执行指令

yum install glib-devel
yum install atk-devel
yum install pango-devel
yum install cairo-devel

6.安装结束后,再次执行 ./configure  出现类似以下图提示,或没有再提示缺失包,则执行成功了

Libgdiplus configure summary

7.依次执行  make 、  sudo make install发生错误

粘贴图片

 

解决:

sudo yum install libjpeg-turbo-devel

8. 安装成功后再次执行   sudo make install ,安装成功

9.依次执行,这时候lib文件夹下生成了gdiplus.dll

cd /usr/lib

ln -s libgdiplus.so gdiplus.dll

10.这时候以为已经成功了,但是报错问题还是存在,后来对比在centos上安装的文件,发现缺少 libgdiplus.so文件

解决:

 

ln -s /usr/local/lib/libgdiplus.so /usr/lib64/libgdiplus.so

ln -s /usr/local/lib/libgdiplus.so /usr/libgdiplus.so

11.再次尝试,没有这个报错了,只是提示导出的文件找不到,需要挂载一下就好了

ln -s /XXX/ /usr/share/(项目文件夹)/wwwroot/XXX

 

参考网站:

https://beginor.github.io/2013/10/15/install-and-config-mono-on-ubuntu-server.html

https://www.cnblogs.com/xtary/p/9528125.html

https://blog.csdn.net/smart_one/article/details/104024599

https://blog.csdn.net/bellwethercoo/article/details/84497077

https://www.thinbug.com/q/42292877

https://www.cnblogs.com/jym-sunshine/p/5312835.html

posted @ 2022-03-09 10:39  苏苏苏en  阅读(693)  评论(0编辑  收藏  举报