2

Linux で動作するコンソール用のスタンドアロン アプリを作成しようとしており、動作環境は Mac os x 10.7 です。

1.) Monodevelop を開き、新しいソリューション「C# コンソール プロジェクト」を作成します。2.) アプリをビルドすると、 exeが bin/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]

私が間違っていることについて何か提案はありますか?osx から開発されたスタンドアロンの Linux アプリが必要です。何時間も髪を引っ張っています。

4

1 に答える 1

3

OSX プラットフォームから Linux プラットフォームで使用されるバイナリをビルドすることはできません。mkbundleは、中間/JIT コンパイル可能/MSIL コードではなく、ネイティブプラットフォーム コードをビルドすることに注意してください。

これでは OSX で発生したエラーは解決されません (何が問題なのかわかりません) が、アプリを Linux で実行する場合は、Linux ボックスに Mono をインストールし、そこから mkbundle を実行します。

于 2012-10-13T12:58:50.253 に答える