MonoGame Noob - Unable to load 'FreeImage'

Hey guys,

I’m new to MonoGame (but not XNA), so please bear with me.

I installed MonoGame 3.4 for Visual Studio and I’m running Windows 7 64-bit with Visual Studio 2010 Professional.

I created a new MonoGame Windows Project and added a png file to my Content.mgcb file using the MonoGame Pipeline GUI. However, when I try to build the mgcb file, I get the following error:

error: Importer ‘TextureImporter’ had unexpected failure!
System.DllNotFoundException: Unable to load DLL ‘FreeImage’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at FreeImageAPI.FreeImage.GetFileType(String filename, Int32 size)
at FreeImageAPI.FreeImage.LoadEx(String filename, FREE_IMAGE_LOAD_FLAGS flags, FREE_IMAGE_FORMAT& format)
at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent)

I have verified that this file exists under c:\Program Files (x86)\MSBuild\MonoGame\v3.0\tools\

Any ideas?

Thanks!
-Chris B.

1 Like

Any thoughts on this? I’ve googled this to death, and I’ve found similar threads on this and other boards, but no clear resolution.

I’ve tried copying freeimage.dll and freeimageNet.dll to the Windows and Windows\System32 directories, setting environment variables, and running as Administrator, but nothing seems to help.

If I’m unable to build my content using the MonoGame Pipeline, are there any workarounds?

Thanks again,
-Chris B.

Finally figured it out!

For anyone else having this issue, I had to install the following:

Visual C++ Redistributable for Visual Studio 2012 Update 4
http://www.microsoft.com/en-NZ/download/details.aspx?id=30679

2 Likes

This solution doesn’t work anymore –

Microsoft has removed the VC++ 2012 Redistributable.

Here’s a Microsoft link that worked for me:
https://www.microsoft.com/en-us/download/details.aspx?id=30679

This link above from Refy triggered all sorts of popups/spam warnings for me.

1 Like

For me it helped to install the Visual C++ Redistributable 2013, although i use visual studio 2015.

I just got this error for the freeimage dll not found when i tried to put this on my laptop.

Where is this dll supposed to be located ?
Is this shipped with monogame or is it a expected system file.

Edit
All the dll’s and libs were in the system and monogame folders in the right places ect.
So instead of trying to figure out how to link to the shared dll directly or mess with the env variables.
I just opened up the vs studio installer and installed in all the optional c++ sdk’s which fixed it.

感谢!!!! 搞了半天这个问题 纠结了很久

Use the vs installer and download the optional c++ sdks for 2012 2013.
If you don’t know were it is just type in the start menu.
“Visual Studio Installer” it should pop right up.

In case your curious.

感谢!!!! 搞了半天这个问题 纠结了很久
thank! ! ! ! Engaged in the problem for a long time, tangled for a long time