Arch - MGCB.exe exited with code: 255 (System.DllNotFoundException: freetype6.dll)

I’ve recently installed Arch and am trying to compile my MonoGame project for it. Everything worked fine on Debian, so I am unsure what I am missing here. Here is the build output I get:

Task "Exec"
    mono "/run/media/jesuszilla/Roll/dev/Blugen/packages/MonoGame.Content.Builder.3.7.0.9/tasks/net46/../../build/MGCB/build/MGCB.exe" /@:"/run/media/jesuszilla/Roll/dev/Blugen/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"
    setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
    Skipping /run/media/jesuszilla/Roll/dev/Blugen/Content/PaletteShader.fx
    Skipping /run/media/jesuszilla/Roll/dev/Blugen/Content/System/Lifebar/timer.bmp
    /run/media/jesuszilla/Roll/dev/Blugen/Content/System/Lifebar/name.bmp
    /run/media/jesuszilla/Roll/dev/Blugen/Content/System/Lifebar/Whiskey Bravo Victor.spritefont
        Building Font /home/jesuszilla/.fonts/w/Whiskey_Bravo_Victor.ttf
    Processor 'FontDescriptionProcessor' had unexpected failure!
    System.DllNotFoundException: freetype6.dll
      at (wrapper managed-to-native) SharpFont.FT.FT_Init_FreeType(intptr&)
      at SharpFont.Library..ctor () [0x00007] in <1ab1c07fc69249aba62188cb35238785>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.Import (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription options, System.String fontName) [0x00000] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.ImportFont (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription options, System.Single& lineSpacing, System.Int32& yOffsetMin, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context, System.String fontName) [0x00052] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x001a7] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2[TInput,TOutput].Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (System.Object input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x0002f] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00146] in <a8187ab05ac74536b778a0faf7f547ba>:0 
    Skipping /run/media/jesuszilla/Roll/dev/Blugen/Content/Blending.fx
    Unhandled Exception:
    System.DllNotFoundException: freetype6.dll
      at (wrapper managed-to-native) SharpFont.FT.FT_Done_FreeType(intptr)
      at SharpFont.Library.Dispose (System.Boolean disposing) [0x001a3] in <1ab1c07fc69249aba62188cb35238785>:0 
      at SharpFont.Library.Finalize () [0x00000] in <1ab1c07fc69249aba62188cb35238785>:0 
    [ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: freetype6.dll
      at (wrapper managed-to-native) SharpFont.FT.FT_Done_FreeType(intptr)
      at SharpFont.Library.Dispose (System.Boolean disposing) [0x001a3] in <1ab1c07fc69249aba62188cb35238785>:0 
      at SharpFont.Library.Finalize () [0x00000] in <1ab1c07fc69249aba62188cb35238785>:0 
    The command "mono "/run/media/jesuszilla/Roll/dev/Blugen/packages/MonoGame.Content.Builder.3.7.0.9/tasks/net46/../../build/MGCB/build/MGCB.exe" /@:"/run/media/jesuszilla/Roll/dev/Blugen/Content/Content.mgcb" /platform:DesktopGL /quiet /outputDir:"bin/DesktopGL/Content" /intermediateDir:"obj/DesktopGL/Content"" exited with code 255.

I’ve installed the freetype2 package using pacman, which should contain libfreetype6, so I am totally lost as to what’s going on here. The standalone pipeline works fine, but not being able to debug in MonoDevelop is a pain.

EDIT: I just added SharpFont.dll.config with the following contents to the NuGet package folder for MonoGame.Content.Builder.3.7.0.9 (grabbed from MonoGame.Dependencies repo):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <dllmap dll="freetype6.dll">
        <dllentry os="linux" dll="libfreetype.so.6" />
        <dllentry os="osx" dll="libfreetype.6.dylib" />
    </dllmap>
</configuration>

Now I get a different error:

System.NullReferenceException: Object reference not set to an instance of an object
      at (wrapper unknown) SharpFont.Internal.GlyphSlotRec.PtrToStructure(intptr,object)
      at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.PtrToStructure(intptr,System.Type)
      at SharpFont.PInvokeHelper.PtrToStructure[T] (System.IntPtr reference) [0x00000] in <1ab1c07fc69249aba62188cb35238785>:0 
      at SharpFont.GlyphSlot.set_Reference (System.IntPtr value) [0x00007] in <1ab1c07fc69249aba62188cb35238785>:0 
      at SharpFont.GlyphSlot..ctor (System.IntPtr reference, SharpFont.Face parentFace, SharpFont.Library parentLibrary) [0x00006] in <1ab1c07fc69249aba62188cb35238785>:0 
      at SharpFont.Face.get_Glyph () [0x0001b] in <1ab1c07fc69249aba62188cb35238785>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.ImportGlyph (System.Char character, SharpFont.Face face) [0x00011] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Graphics.SharpFontImporter.Import (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription options, System.String fontName) [0x0002f] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.ImportFont (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription options, System.Single& lineSpacing, System.Int32& yOffsetMin, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context, System.String fontName) [0x00052] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor.Process (Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x001a7] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at Microsoft.Xna.Framework.Content.Pipeline.ContentProcessor`2[TInput,TOutput].Microsoft.Xna.Framework.Content.Pipeline.IContentProcessor.Process (System.Object input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context) [0x0002f] in <a8187ab05ac74536b778a0faf7f547ba>:0 
      at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent (MonoGame.Framework.Content.Pipeline.Builder.PipelineBuildEvent pipelineEvent) [0x00146] in <a8187ab05ac74536b778a0faf7f547ba>:0 

This looks very similar to an issue that was on OS X. Does anyone know the solution?

I ran into this on my laptop on windows and had to instal the optional dll’s for the c++ runtime sdks.

Yeah, this is Linux, that’s not applicable.