gpt4 book ai didi

macos - Mono c# 控制台应用程序,创建独立的 mkbundle 错误

转载 作者:行者123 更新时间:2023-12-04 05:28:57 25 4
gpt4 key购买 nike

尝试为可在 Linux 上运行的控制台创建一个独立的应用程序,工作环境在 Mac os x 10.7 上。

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

这会发生:

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]

关于我做错了什么的任何建议?想要一个从 osx 开发的独立 linux 应用程序。拉我的头发几个小时。

最佳答案

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

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

关于macos - Mono c# 控制台应用程序,创建独立的 mkbundle 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12873326/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com