首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mono c#控制台应用程序,创建具有mkbundle错误的独立程序

Mono c#控制台应用程序,创建具有mkbundle错误的独立程序
EN

Stack Overflow用户
提问于 2012-10-13 12:56:17
回答 1查看 1K关注 0票数 2

为了在Linux上创建一个独立的控制台应用程序,工作环境是在Mac x10.7上进行的。

1.)打开Monodevelop并创建新的解决方案,即"C#控制台项目“。2.)构建应用程序时,exe将在bin/Release文件夹3中创建。)在mac os x打开终端中,goto文件夹并键入:mkbundle -o HelloTest HelloWorld.exe -deps

这将发生:

代码语言:javascript
复制
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开发。拉我的头发好几个小时。

EN

回答 1

Stack Overflow用户

发布于 2012-10-13 12:58:50

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

这并不能解决OSX上的错误(我不知道出了什么问题),但是如果您想让应用程序在Linux上运行,请在Linux上安装Mono,然后从那里运行mkbundle。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12873326

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档