• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Dark-Table · Aug 22, 2011 at 01:19 AM · macstandalonedllnotfoundexception

How do you load System.Drawing.dll and gdiplus.dll on Unity Mac?

I've got a project that is using an external assembly that requires System.Drawing.dll and gdiplus.dll.

Gdiplus.dll is a native dll for windows. There's a version of it for mono platforms called libgdiplus. I've built this for the Mac, but can't figure out how to convince Unity (Editor or Mac Standalone) to load this dylib (libgdiplus.dylib). The dylib is currently living in /opt/local/lib and that folder is on my system path.

When I attempt to run the project I get the following error:

 DllNotFoundException: gdiplus.dll
 System.Drawing.GDIPlus..cctor ()
 Rethrow as TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus
 System.Drawing.Image.Dispose (Boolean disposing)
 System.Drawing.Image.Finalize ()

The Mono documentation seems to indicate that Mono will automatically attempt to append lib to the name of the dll and swap the dll for dylib if it can't find the requested dll. I'm not sure if the version of Mono that Unity uses does this as well?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DanSuper · Jan 09, 2013 at 07:32 PM 1
Share

I'd love to know if you ever solved this because I'm also having the same issue trying to integrate the AForge imaging library with Unity.

avatar image Dark-Table · Jan 11, 2013 at 03:54 AM 0
Share

No, I never did manage to solve this. Sorry. I believe it was AForge that I was working with too.

avatar image PraetorBlue · Dec 22, 2013 at 06:14 AM 0
Share

I'm also having this problem... here in 2013 :(

avatar image VReel · Mar 26, 2017 at 09:17 AM 0
Share

Now in 2017, do we have a solution for this?

I'm simply trying to make use of the System.Drawing.Bitmap class, on Android, but the construction is failing due to "gdiplus.dll" not being found.

Thanks in advance...

8 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by khaledElshimy · Jul 09, 2019 at 11:24 PM

Hi, i tried your solution it worked in the editor but didn't work in the build

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by WIBadger · Dec 14, 2019 at 07:20 PM

So, I am getting this error with OS X Catalina:

DllNotFoundException: /Users/bokken/build/output/Unity-Technologies/mono/external/buildscripts/add_to_build_results/monodistribution/lib/libgdiplus.dylib

  • I have tried all of the above solutions with no success. I have also tried adding the libgdiplus with homebrew.

  • Has anyone else had this problem and resolved it? Thanks!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mrawlik · May 14, 2021 at 09:36 PM

I could solved it by

  1. Installing the GDI+ for mac brew install mono-libgdiplus

  2. Grabbing the /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/libgdiplus.0.dylib file and copying it to my project's Assets/Plugins/libgdiplus.dylib

  3. Editing the`/Applications/Unity/Hub/Editor/2020.3.2f1/Unity.app/Contents/MonoBleedingEdge/etc/mono/config` file (note the version of the editor) by adding lines:

<dllmap dll="gdiplus" target="libgdiplus.dylib" />

<dllmap dll="gdiplus.dll" target="libgdiplus.dylib" />

This makes it work in the editor.

  1. After the build manually editing the xxx.app/Contents/MonoBleedingEdge/etc/mono/config file and adding the same lines.

This makes the build work.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • ‹
  • 1
  • 2

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does my DLL only throw a DllNotFoundException in the Editor? 3 Answers

Mac Standalone build immediately crashes 0 Answers

Window/Fullscreen Information - Mac Standalone Player 1 Answer

export standalone video on mac and pc 1 Answer

Running Mac Standalone Player In Batchmode 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges