Mkbundle failed to compile C# application on OS X

落爺英雄遲暮 提交于 2019-12-04 19:07:20

I worked out what the issue was in the end - I saw running into both the new mkbundle property requirements and some mismatched architecture settings. The below script worked for me:

#!/bin/bash

# Notes:
# You will need the Mono SDK 3.x series as the 2.x SDK cannot build for 64bit architectures.
# It appears that Mono 3.x still cannot compile for 64bit without having to manually compile Mono yourself.
# Since we don't strictly need 64bit support the below forces a 32bit build.

# Ensure it can find pkg-config:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/pkgconfig

# Force 32bit build and manually set some clang linker properties:
export AS="as -arch i386"
export CC="cc -arch i386 -lobjc -liconv -framework Foundation"

# Build:
mkbundle bin/Release/Launcher.exe --static --deps -o bin/Release/OSXNative/Launcher.exe
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!