New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build content - Cannot load FreeImage #3556

Open
danzel opened this Issue Feb 21, 2015 · 14 comments

Comments

Projects
@danzel
Contributor

danzel commented Feb 21, 2015

C:/BuildAgent/work/e640bfb9e46917d7/SimpullsContent/Debug/../clouds.png: error:
Importer 'TextureImporter' had unexpected failure!
System.DllNotFoundException: Unable to load DLL 'FreeImage': The specified modul
e 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 FreeImageAPI.FreeImage.LoadEx(String filename)
   at Microsoft.Xna.Framework.Content.Pipeline.TextureImporter.Import(String fil
ename, ContentImporterContext context) in c:\Users\danzel\Code\Simpulls\MonoGame
\MonoGame.Framework.Content.Pipeline\TextureImporter.cs:line 85
   at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.F
ramework.Content.Pipeline.IContentImporter.Import(String filename, ContentImport
erContext context) in c:\Users\danzel\Code\Simpulls\MonoGame\MonoGame.Framework.
Content.Pipeline\ContentImporter.cs:line 45
   at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent
(PipelineBuildEvent pipelineEvent) in c:\Users\danzel\Code\Simpulls\MonoGame\Mon
oGame.Framework.Content.Pipeline\Builder\PipelineManager.cs:line 575
Build 0 succeeded, 1 failed.

Time elapsed 00:00:00.29.

Solution was to install the x64 version of vs 2012 c++ redistributable
http://www.microsoft.com/en-NZ/download/details.aspx?id=30679

We should probably have a nicer error for this if we can, spent ages bashing at this! (Dependency Walker told me what the missing dll was)

@tomspilman

This comment has been minimized.

Show comment
Hide comment
@tomspilman

tomspilman Feb 21, 2015

Member

Hum... the redist we need vcredist_x64.exe is only 7MB. If you download and run it from the command line:

vcredist_x64.exe -?

It tells you that it has /quiet and /norestart mode:

capture

We should be able to embed this into the Windows installer fairly easily if we want.

Either that or we just add a note about it on the download site.

Member

tomspilman commented Feb 21, 2015

Hum... the redist we need vcredist_x64.exe is only 7MB. If you download and run it from the command line:

vcredist_x64.exe -?

It tells you that it has /quiet and /norestart mode:

capture

We should be able to embed this into the Windows installer fairly easily if we want.

Either that or we just add a note about it on the download site.

@theZMan

This comment has been minimized.

Show comment
Hide comment
@theZMan

theZMan Feb 22, 2015

Contributor

Nobody reads websites - installers should include everything that is needed..

Contributor

theZMan commented Feb 22, 2015

Nobody reads websites - installers should include everything that is needed..

@KonajuGames

This comment has been minimized.

Show comment
Hide comment
@KonajuGames

KonajuGames Feb 23, 2015

Contributor
Contributor

KonajuGames commented Feb 23, 2015

@Vutov

This comment has been minimized.

Show comment
Hide comment
@Vutov

Vutov Jun 12, 2015

Thanks mate, I had the same issue, thankfully found this posts.

Vutov commented Jun 12, 2015

Thanks mate, I had the same issue, thankfully found this posts.

@gms9rc

This comment has been minimized.

Show comment
Hide comment
@gms9rc

gms9rc Mar 21, 2016

UPDATE:

Problem solved. Despite the fact that I am using VS2012 I needed to install the 2013 redistributable. Right here for anyone who comes across this problem https://www.microsoft.com/en-us/download/details.aspx?id=40784

ORIGINAL:

I'm having this issue now after upgrading to MonoGame 3.5. I'm using Visual Studio 2012 and .NET 4.5. I tried using vcredist_x64.exe and the installer seemed to work, so I'm kind of lost on what to do here. I verified that FreeImage.dll is in the right folder.

Build started 3/20/2016 8:44:44 PM

E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/20151010_120240.jpg
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/20151010_120240.jpg: 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)
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/signature.png
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/signature.png: 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)

Build 0 succeeded, 2 failed.

Time elapsed 00:00:00.13.

gms9rc commented Mar 21, 2016

UPDATE:

Problem solved. Despite the fact that I am using VS2012 I needed to install the 2013 redistributable. Right here for anyone who comes across this problem https://www.microsoft.com/en-us/download/details.aspx?id=40784

ORIGINAL:

I'm having this issue now after upgrading to MonoGame 3.5. I'm using Visual Studio 2012 and .NET 4.5. I tried using vcredist_x64.exe and the installer seemed to work, so I'm kind of lost on what to do here. I verified that FreeImage.dll is in the right folder.

Build started 3/20/2016 8:44:44 PM

E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/20151010_120240.jpg
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/20151010_120240.jpg: 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)
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/signature.png
E:/Documents/Visual Studio 2012/Projects/temp/Game1/Game1/Content/signature.png: 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)

Build 0 succeeded, 2 failed.

Time elapsed 00:00:00.13.

@ricardosabino

This comment has been minimized.

Show comment
Hide comment
@ricardosabino

ricardosabino Apr 16, 2016

I'm having a very similar problem where freetype6.dll can't be found although it's in the same folder of the pipeline tool.

Building Font C:\WINDOWS\Fonts\arial.ttf
System.DllNotFoundException: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)
at SharpFont.Library..ctor()

I've attached the list of redists installed on my machine so I'm not sure if this is a redist issue or something else.

msvcrs

ricardosabino commented Apr 16, 2016

I'm having a very similar problem where freetype6.dll can't be found although it's in the same folder of the pipeline tool.

Building Font C:\WINDOWS\Fonts\arial.ttf
System.DllNotFoundException: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)
at SharpFont.Library..ctor()

I've attached the list of redists installed on my machine so I'm not sure if this is a redist issue or something else.

msvcrs

@Tzenchor

This comment has been minimized.

Show comment
Hide comment
@Tzenchor

Tzenchor Apr 16, 2016

Contributor

I have just compared your redist with mine, and the only difference is that from the 2013 ones I only have the version 12.0.21005, and from the 2012 packages you are missing the x86 11.0.60610, the rest are the same

Contributor

Tzenchor commented Apr 16, 2016

I have just compared your redist with mine, and the only difference is that from the 2013 ones I only have the version 12.0.21005, and from the 2012 packages you are missing the x86 11.0.60610, the rest are the same

@ricardosabino

This comment has been minimized.

Show comment
Hide comment
@ricardosabino

ricardosabino Apr 17, 2016

I was able to fix it by repairing my 2012 x64 redist 11.0.61030.0.

ricardosabino commented Apr 17, 2016

I was able to fix it by repairing my 2012 x64 redist 11.0.61030.0.

@tomspilman tomspilman added this to the 3.6 Release milestone Apr 17, 2016

@abyssdoor

This comment has been minimized.

Show comment
Hide comment
@abyssdoor

abyssdoor Jun 22, 2016

I'll just say I came here having the same problem, thankfully it was solved by installing the 2013 redistributable, but I think i my case the culprit was a DivX update (as soon as I noticed it was installing some c++ libraries I thought "this will haunt me later, right?")

abyssdoor commented Jun 22, 2016

I'll just say I came here having the same problem, thankfully it was solved by installing the 2013 redistributable, but I think i my case the culprit was a DivX update (as soon as I noticed it was installing some c++ libraries I thought "this will haunt me later, right?")

@BrainSlugs83

This comment has been minimized.

Show comment
Hide comment
@BrainSlugs83

BrainSlugs83 Jul 3, 2016

So, I ran into this today, and this is super weird, because I was able to build this project in mid-April (2016) on this machine -- I haven't uninstalled the VC redists or anything since then, but it all worked at that time -- I'm running the same version of MonoGame that I was then (literally, nothing has changed) -- same version of Visual Studio, everything. -- but today I opened the project, and it won't build with this error.

I installed the VC++ 2013 (x64) Redistributable that @gms9rc linked to; and that fixed it... but ... how come I didn't need this in April, and suddenly I need this now?? O.O

BrainSlugs83 commented Jul 3, 2016

So, I ran into this today, and this is super weird, because I was able to build this project in mid-April (2016) on this machine -- I haven't uninstalled the VC redists or anything since then, but it all worked at that time -- I'm running the same version of MonoGame that I was then (literally, nothing has changed) -- same version of Visual Studio, everything. -- but today I opened the project, and it won't build with this error.

I installed the VC++ 2013 (x64) Redistributable that @gms9rc linked to; and that fixed it... but ... how come I didn't need this in April, and suddenly I need this now?? O.O

@abyssdoor

This comment has been minimized.

Show comment
Hide comment
@abyssdoor

abyssdoor Jul 3, 2016

based from my own experience you probably installed or updated something in your computer that updated c++ libraries in the background, in my case it was the DivX Updater which messed with them

abyssdoor commented Jul 3, 2016

based from my own experience you probably installed or updated something in your computer that updated c++ libraries in the background, in my case it was the DivX Updater which messed with them

@tomspilman

This comment has been minimized.

Show comment
Hide comment
@tomspilman

tomspilman Jul 3, 2016

Member

Actually the best fix here is to rebuild FreeImage to use the static version of the C runtime libraries. This way it won't have any dependency on those redistributables.

This is the same issue with MojoShader... see #4485.

Member

tomspilman commented Jul 3, 2016

Actually the best fix here is to rebuild FreeImage to use the static version of the C runtime libraries. This way it won't have any dependency on those redistributables.

This is the same issue with MojoShader... see #4485.

@kras-imex-6

This comment has been minimized.

Show comment
Hide comment
@kras-imex-6

kras-imex-6 Feb 4, 2017

I have the same error. MonoGame is not working !!! (((

kras-imex-6 commented Feb 4, 2017

I have the same error. MonoGame is not working !!! (((

@tomspilman tomspilman modified the milestones: 3.6 Release, 3.7 Release Mar 9, 2017

@yyr57695

This comment has been minimized.

Show comment
Hide comment
@yyr57695

yyr57695 Mar 20, 2017

I ran into this exact issue today when attempting to build images into my content pipeline under a fresh install of Windows 10 Pro, Visual Studio 2017, and the stable release of MonoGame 3.6.0.1625. It was fixed by installing the 2013 redistributable as linked in gms9rc's post above.

This was accompanied by a similar error when the pipeline got up to building in my SpriteFont:

Processor 'FontDescriptionProcessor' had unexpected failure!
System.DllNotFoundException: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)
at SharpFont.Library..ctor()
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.Import(FontDescription options, String fontName)
...

I was able to fix this issue by installing this: (http://www.microsoft.com/en-NZ/download/details.aspx?id=30679)
as recommended here: (http://community.monogame.net/t/monogame-noob-unable-to-load-freeimage/6255)

It's unfortunate that these components have to be manually fetched...it'd be great if this was easier in the future! (If a more recent MonoGame build has already fixed this, I apologize for not trying it.)

yyr57695 commented Mar 20, 2017

I ran into this exact issue today when attempting to build images into my content pipeline under a fresh install of Windows 10 Pro, Visual Studio 2017, and the stable release of MonoGame 3.6.0.1625. It was fixed by installing the 2013 redistributable as linked in gms9rc's post above.

This was accompanied by a similar error when the pipeline got up to building in my SpriteFont:

Processor 'FontDescriptionProcessor' had unexpected failure!
System.DllNotFoundException: Unable to load DLL 'freetype6.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary)
at SharpFont.Library..ctor()
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.Import(FontDescription options, String fontName)
...

I was able to fix this issue by installing this: (http://www.microsoft.com/en-NZ/download/details.aspx?id=30679)
as recommended here: (http://community.monogame.net/t/monogame-noob-unable-to-load-freeimage/6255)

It's unfortunate that these components have to be manually fetched...it'd be great if this was easier in the future! (If a more recent MonoGame build has already fixed this, I apologize for not trying it.)

@tomspilman tomspilman self-assigned this Mar 12, 2018

@cra0zy cra0zy added this to Update Native Dependency in 3.7 Release Mar 31, 2018

@tomspilman tomspilman modified the milestones: 3.7 Release, 3.8 Release Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment