Last active
March 10, 2024 07:35
-
-
Save mtolly/384dbe51f4a78d6d2818 to your computer and use it in GitHub Desktop.
How to build and install the Mono libgdiplus.dll on a Mac with Homebrew (update: no longer needed, see comments)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# First install XQuartz, then... | |
brew install freetype fontconfig libpng | |
ln -s /opt/X11/include/X11 /usr/local/include/X11 | |
git clone [email protected]:mono/libgdiplus | |
cd libgdiplus | |
./autogen.sh | |
make install |
These two alone didn't fix the error on my M1 MacBook pro.
$ brew install mono-libgdiplus
$ sudo ln -s /opt/homebrew/opt/mono-libgdiplus/lib/libgdiplus.dylib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.0
After this third command the program ran without error.
$ sudo ln -s /opt/homebrew/opt/mono-libgdiplus/lib/libgdiplus.dylib /usr/local/lib/
Solution for M1 Macbook pro
- HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall mono-libgdiplus
- sudo ln -s /opt/homebrew/opt/mono-libgdiplus/lib/libgdiplus.dylib /usr/local/lib/liblibgdiplus
now works fine.
Solution for M1 Macbook pro
- HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall mono-libgdiplus
- sudo ln -s /opt/homebrew/opt/mono-libgdiplus/lib/libgdiplus.dylib /usr/local/lib/liblibgdiplus
now works fine.
@hariharankanakaraja Thanks man! You saved my time. I have trapped here for 2 days since the compatibility of ARM Macs really suck.
Solution for M1 Macbook pro
- HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall mono-libgdiplus
- sudo ln -s /opt/homebrew/opt/mono-libgdiplus/lib/libgdiplus.dylib /usr/local/lib/liblibgdiplus
now works fine.
Thanks! You saved me man
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get this working with C#/System.Drawing, just do:
(Which is where the system looks for the library at runtime)