1. 程式人生 > 其它 >unbuntu arm64 匯出檔案報錯“The type initializer for 'Gdip' threw an exception”

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  出現類似以下圖提示,或沒有再提示缺失包,則執行成功了

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