2012-10-13 96 views
2

试图为可在Linux上工作的控制台创建独立应用程序,工作环境位于Mac OS X 10.7上。Mono c#控制台应用程序,使用mkbundle错误创建独立程序

1.)打开Monodevelop并创建一个新的解决方案,一个“C#控制台项目”。 mkbundle -o HelloTest HelloWorld.exe的--deps

: 2.)建立该应用中,exe将在仓/ Release文件夹 3.)在Mac OS X的开路端,转到文件夹和类型创建

这将发生:

OS is: Darwin 
Sources: 1 Auto-dependencies: True 
    embedding: /Users/fredrickbacker/Documents/Mono/HelloWorld/HelloWorld/bin/Release/HelloWorld.exe 
    embedding: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/mscorlib.dll 
Compiling: 
as -arch i386 -o temp.o temp.s 
cc -arch i386 -g -o HelloTest -Wall temp.c `pkg-config --cflags --libs mono-2` temp.o 
temp.c:2:39: error: mono/metadata/mono-config.h: No such file or directory 
temp.c:3:36: error: mono/metadata/assembly.h: No such file or directory 
temp.c:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘assembly_bundle_HelloWorld_exe’ 
temp.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘assembly_bundle_mscorlib_dll’ 
temp.c:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token 
temp.c:22: error: ‘NULL’ undeclared here (not in a function) 
temp.c: In function ‘mono_mkbundle_init’: 
temp.c:26: warning: implicit declaration of function ‘mono_register_bundled_assemblies’ 
temp.c:26: error: ‘bundled’ undeclared (first use in this function) 
temp.c:26: error: (Each undeclared identifier is reported only once 
temp.c:26: error: for each function it appears in.) 
temp.c: In function ‘main’: 
temp.c:118: warning: implicit declaration of function ‘mono_set_dirs’ 
[Fail] 

对我在做什么有什么建议吗?需要一个独立的Linux应用程序,从osx开发。拉我的头发好几个小时。

+0

MacPack是否适合您? –

回答

3

您不能在OSX上创建将在Linux平台上使用的二进制文件。请记住,mkbundle构建原生平台代码,而不是中间/ JIT编译/ MSIL代码。

这并不能解决你在OSX上遇到的错误(我不知道发生了什么问题),但是如果你想让你的应用在Linux上运行,请在Linux上安装Mono并从那里运行mkbundle。