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

一笑奈何 提交于 2019-12-06 17:04:17

问题


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?


回答1:


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"



回答2:


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"



回答3:


Try reinstalling Mono Development Kit (MDK). Do not install Mono Runtime Environment (MRE) on top of MDK. MDK will suffice.

Then, if you're using Windows (but I guess you're on OSX -- but just to mention): you will need a Unix-like toolchain for mkbundle to to work.

Excerpt: from their site

On Windows systems, it it necessary to have Unix-like toolchain to be installed for mkbundle to work. You can use cygwin's and install gcc, gcc-mingw and as packages. (sic)



来源:https://stackoverflow.com/questions/13979044/mkbundle-on-mac-with-mono-mono-metadata-mono-config-h-file-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!