Issue porting from Windows to Linux

Hello,

My friend and I are trying to create a game, he’s on Windows and I’m on Linux (edit: BunsenLabs, based off of Debian). When I cloned from our GitHub repository, I was able to load the project into MonoDevelop. However, when I tried to build the game, I got this error message:

/usr/lib/mono/xbuild/MonoGame/v3.0/MonoGame.Content.Builder.targets: Error: Command ‘/usr/bin/mono “/usr/lib/mono/xbuild/MonoGame/v3.0/Tools/MGCB.exe” /@:"[location]/Content/Content.mgcb" /platform:DesktopGL /outputDir:"[location]/Content/bin/DesktopGL" /intermediateDir:"[location]/Content/obj/DesktopGL" /quiet’ exited with code: 1.

I’ve never used MonoGame or MonoDevelop before, and I’m unsure of how to fix this error. Since it mentions the “MGCB.exe” file I think it might be a build option that I have to configure for Linux. Is this correct, and how do I do fix it?

Thanks

If you open the .mgcb with the pipeline tool and try to build, you’ll get a more descriptive error message. If you have effect files, you can only build those on Windows for now.

1 Like

Correction, If you have effect files you can build them with Infinitespace Studios Effect processor: http://www.infinitespace-studios.co.uk/general/monogame-building-fx-shaders-on-a-mac-and-linux/

2 Likes

Thanks for the reply. My friend says he hasn’t used any shaders, which I believe is what you’re referring to.

How do I open the .mgcb with the pipeline tool? When I select it in the tree and use Open With -> MonoGame Pipeline Tool, nothing happens. In the Tools folder I don’t see any linux executable files related to the pipeline or MGCB, only .exe files.

Edit: I figured out how to open the pipeline tool with mono. It looks like the issue is with a font we’re using.

Building font.spritefont
[location]/Content/font.spritefont
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

I don’t see ‘index’ anywhere in the font file. Is this an issue that I can fix on my end or an issue with the font? My friend had no problem building it.

You are using a system font that doesn’t exist on Linux. You can copy the font file that is used to the same directory as .spritefont file and edit the spritefont file so that under FontName it has the fonts file name (not file path).

1 Like

I feel dumb now. Thank you very much for your help.