1

I want to embed Mono into a 64 bit Mac OSX application (ported from Windows C++ where everything works fine). Since only 32 bit Mono is available pre-compiled for Mac OSX I managed to build my own 64 bit Mono release following this manual.

When debugging my 64 bit application in XCode the mono-embedding initialization fails with "The assembly mscorlib.dll was not found or could not be loaded. It should have been installed in the `usr/local/lib/mono/4.5' directory."

I can step into the code where this error is generated (domain.c - mono_init_internal()). Unfortunately my mono build obviously didn't produce a 4.5 directory. The only available ".NET-Version" seems to be 2.0: usr/local/lib/mono/2.0/mscorlib.dll exists, BUT NO 4.5 subdirectory at all.

Is there something I forgot in the build?

Thank you very much for your support.

Chris M
  • 73
  • 7

2 Answers2

0

An alternate solution is to take a Mono 32 bits distribution, build the 64 binaries (without the MCS), and merge the result back.

This is the way this project works in order to provide universal binaries. You can adapt it in order to replace the binaries instead of merging them.

Laurent Etiemble
  • 27,111
  • 5
  • 56
  • 81
  • Thank you very much for your answer. Unfortunately I'm too new to both, mono embedding and Mac programming (or too ignorant...) to understand how to follow your advice. Could you please explain in – Chris M May 20 '14 at 10:19
  • Thank you very much for your answer. Unfortunately I'm too new to both, mono embedding and Mac programming (or too ignorant...) to understand how to follow your advice. Could you please explain in detail what steps I should take. I already have a 32 bit distro and my self-built 64 Mono on the machine. Thank you! – Chris M May 20 '14 at 10:26
0

Found it. The answer to my question "Is there something I forgot in the build?" is YES! Apparently, by default, ./configure; make; compiles all available .NET platforms (2.0, 3.5., 4.0, 4.5). After building you can find them all under {UnpackedTarBall}/mcs/class/lib - there are net_2_0, net_3_5, net_4_0 and net_4_5 subdirectories. Unfortunately "make install" only installs .Net 2.0 as described in my original post. I managed to install the other profiles by the following sequence:

$ cd {UnpackedTarBall}/mcs
$ make PROFILE=net_4_5 install

repeat and replace the above for other profiles (net_3_5, net_4_0). There are some helpful hints in {UnpackedTarBall}/mcs/README.

Chris M
  • 73
  • 7
  • I'm not sure if that's correct. At least on linux the 'make' and 'make install' commands install all versions. My issue was that there was a missing file, causing the 'make install' to fail right after installing the 2.0 version, meaning no other versions got installed. See For those experiencing this issue with the 3.4 release, see http://stackoverflow.com/questions/22285830/linux-mono-installation-and-errors/23904603 – natli May 28 '14 at 07:04