Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mkbundle on Mac with Mono: "mono/metadata/mono-config.h" file not found

I'm trying to create a Mac bundle with Mono. When I execute:

    mkbundle file.exe --deps -o FILE

I get this during compilation:

    fatal error: "mono/metadata/mono-config.h" file not found

Am I missing something?

like image 374
user1190650 Avatar asked Dec 20 '12 19:12

user1190650


2 Answers

The key is the preceding error (sh: pkg-config: command not found), note that pkg-config is stored at '/Library/Frameworks/Mono.framework/Commands'.

Solution (see here and here):

Prepend the "/Library/Frameworks/Mono.framework/Commands" folder to your PATH variable:

export PATH=/Library/Frameworks/Mono.framework/Commands:$PATH

In addition (as proposed by aiapatag and the objective-c runtime and CoreFoundation framework solution proposed here).

export AS="as -arch i386"
export CC="cc -arch i386 -framework CoreFoundation -lobjc -liconv"
like image 179
Tal Aloni Avatar answered Nov 19 '22 21:11

Tal Aloni


I had this same problem on my Mac. I solved it by setting pkg-config.

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/3.0.12/lib/pkgconfig

Just a heads up, for Mac you have to...

export AS="as -arch i386"
export CC="cc -arch i386"

...as stated here An issue when running mono 2.10.2 mkbundle on Mac OS X snow leopard but on Mountain Lion, I had to do this instead so that the app could run on Lion.

export AS="as -arch i386"
export CC="clang -arch i386 -mmacosx-version-min=10.6"
like image 7
John Misciagno Avatar answered Nov 19 '22 23:11

John Misciagno