Lucas Meijer

Game Development Consultancy

14 Feb, 2009

Want to build Mono on Windows?

This is my “Things not to forget when building mono on windows” list. Hopefully it will be of use to somebody else too.

  • Remember that this always takes a lot longer than you like.
  • Read this first http://www.mono-project.com/Compiling_Mono_on_Windows.
  • use this:

    cd mono
    make get-monolite-latest

    to get a mcs compiler installed that you will need to compile some mono components.

  • Do not forget to use the make linked to in the mono compiling on windows guide.
  • When the guide says “. /tmp/build_deps/env.sh” that first dot is _not_ to be forgotten.
    You can also use “source /tmp/build_deps/env.sh”. do a sanitycheck with echo $PKG_CONFIG_PATH to see if your paths are really properly set.
  • Remember that pkg-config is a program that gets run by autogen.sh. Autogen.sh basically asks pkg-config “where is library ‘glib’, and what compiler and linkerflags should I add to use it”. try to see if your pkg-config works first. just write “pkg-config –libs glib-2.0″. If that doesn’t work, fix that first.
  • If your pkg-config first worked, but later didn’t work anymore, it is likely that you modified your $PATH environment variable to contain a path to a working mono setup, to get a working mcs for your mono build. If you placed this new path in your $PATH before the rest, it means you’ll now accidentlally use /your/mono/bin/pkg-config, instead of /usr/bin/pkg-config. That is likely a too old version, and actually fails.
  • Do not forget that the relocate-dependencies script linked to in the guideline actually hardcodes a C:\cygwin path. Mine is at H:\cygwin.
  • If you get freezes or errors on something that says [MDOC] blabla.. try appending –with-moonlight=no to your autogen.sh command.
  • If that doesn’t work (as it didn’t for me), manually edit mcs/Makefile, and remove all references to “docs”.
  • Since we patch mono with monoco, don’t forget to apply the monoco patch. If the monoco patch
    doesn’t cleanly apply, it’s usually because of conflicts in mono/mono/mini/Makefile.am, which can easily be resolved manually.
  • Remember to remind linux users that most opensource windows software you can just download, doubleclick the .sln, and have it work. No rocket science needed.
  • Remember to run around like crazy, arms waving, asking yourself why linux projects don’t just ship with their dependencies. (Except for MythTV that just embeds a forked copy of ffmpeg that they update from time to time. Hurray for common sense)
  • Remember to find a copy of the autoconf manual, and burn it.
  • Remember to tune into http://linuxhaters.blogspot.com/

edit:typo

3 Responses to "Want to build Mono on Windows?"

1 | Emil Johansen (AngryAnt)

February 14th, 2009 at 7:33 pm

Avatar

Haha lovely :) Thanks for this guide – will need to use it way sooner than I would have liked. I hope that I, with this guide in hand, will be spared some of the pain you went through :)

2 | Clay Fowler

May 19th, 2009 at 4:31 am

Avatar

“find a copy of the autoconf manual and burn it” AMEN!

3 | William

August 5th, 2010 at 2:49 pm

Avatar

“Remember to remind linux users that most opensource windows software you can just download, doubleclick the .sln, and have it work. No rocket science needed” – Haha, exactly what I thought while doing this myself.

Sometimes, I’m wondering if it’s not just a linux tradition to make things unnecessarily cryptic and difficult for the user…

Comment Form

Game Development Consultancy

Hi. I'm Lucas Meijer. consultant on game development projects I work at Unity. You're looking at my portfolio website.

Please look around, and take a look at my work, my thoughts or more general information about myself.


If you have any questions regarding consulting, licensing of games, or anything else, feel free to email me at lucas@lucasmeijer.com

Contact Info

Lucas Meijer
lucas@lucasmeijer.com
lucasmeijer on twitter
ljmeijer on skype