5

Recently I had some troubles with the MonoGame Content Pipeline tool, not loading textures. The error message said 'freeimage.dll' could not be found. I checked the MonoGame forums for a solution and ended up downloading the 64-bit version of Visual C++ Redistributable Package 2012. This fixed my problem and the Content Pipeline could load .png files once again. Now the pipeline tool is having issues loading .spritefont files. It says it is missing 'freetype.dll'. What's the deal with all these missing .dll files? I just downloaded the VC++ Redistributable Package, but it only fixed the textures, not the fonts.


Update:

I tried downloading the Visual C++ Redistributable Package 2017. However, the problem persists...

Community
  • 1
  • 1
GHC
  • 339
  • 4
  • 13

2 Answers2

4

According to bug report 5736 in Monogame, it's a problem with them linking against the 2012 redistributable (which for a short time, wasn't available for download).

You can try to fix it yourself by compiling freetype6 yourself, following the instructions in the bug report (below), or you can wait for them to fix the problem when bug 4485 is fixed (which appears to address the larger issue with their dependency chain), or you can see if the newer redistrib fixes it.

...

Try downloading VC++ 2012 Update 4 Redistributable:
https://www.microsoft.com/en-us/download/details.aspx?id=30679

Or try compiling freetype6 yourself:

mdrejhon commented on May 25, 2017 •

Eureka! I recompiled FreeType myself and solved this problem.

I only needed to follow a modified version of these instructions: Compiling FreeType to DLL (as opposed to static library)

Download latest FreeType 2.8 from https://www.freetype.org/download.html
Using VS2015 or VS2017, open freetype.sln from the builds\win32\vc2010 directory
Modify solution to target x64 instead of x86
Modify solution to Configuration Type of DLL instead of LIB
Edit ftoption.h to add two lines at top
#define FT_EXPORT(x) __declspec(dllexport) x
#define FT_BASE(x) __declspec(dllexport) x
Change project config to Release
Build.
You will see warnings, but compile succeeds.
You will have a file "freetype28.dll" (for FreeType 2.8)
Rename this file to "freetype6.dll" and copy to C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools
(replacing the original freetype6.dll located there)

Statically linked to 2015 or 2017 works fine.

antiduh
  • 11,853
  • 4
  • 43
  • 66
  • 1
    Thanks, the VC++ 2012 Update 4 fixed it for me on MonoGame 3.7.1 (no need to build from source) – E. Moffat Jan 16 '21 at 20:20
  • Installing VC++ 2012 (or 2013, or 2015) didn't work for me. Anyone has any other idea? I've installed the fonts I use. FreeType6.dll is in the same folder as mgcb.exe. My mgcb build tool builds it fine as long as I open it without the content file and then open the content file from within the tool. If I double click the content file it opens mgcb and I can see the content tree, but clicking on the build button does absolutely nothing (screen stays blank, no error, like I didn't click). When I build in VS i get the error mgcb exited with code -532462766. – Sebastiaan Hoedeman Jan 23 '22 at 18:13
  • @SebastiaanHoedeman - perhaps you should try the 2019 and 2022 runtimes. Perhaps they've updated again. https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 – antiduh Jan 24 '22 at 15:25
  • 1
    @antiduh thanks for your comment. I installed the 2015-2022 version already (should have been a little clearer there), so unfortunately that doesn't help. I find it weird that it does build in the MGCB application when opening it from within the application, when double clicking the Content file to open it, it doesn't build. I have the feeling the problem is somewhere in there... I created a question in which I explained it a little better: https://stackoverflow.com/questions/70825340/monogame-content-not-building-from-vs – Sebastiaan Hoedeman Jan 24 '22 at 18:37
0

Downloading and installing Visual C++ Redistributable Packages for Visual Studio 2013 worked for me.