在Mac OS X雪豹上运行mono 2.10.2 mkbundle时出现的问题

pro*_*eek 4 .net macos mono mkbundle

此页面包含有关Bundles的信息mkbundle,但是当我尝试在Mac上使用它时,我收到此错误消息.

delegate> mkbundle delegate.exe -o delegate
OS is: Darwin
Sources: 1 Auto-dependencies: False
   embedding: /Users/smcho/Desktop/csharp/delegate/delegate.exe
Compiling:
as -o temp.o temp.s 
temp.s:2:unknown section type: symbol_stubs
temp.s:2:Rest of line ignored. 1st junk character valued 112 (p).
[Fail]
Run Code Online (Sandbox Code Playgroud)

这个网站,我可以跑来export AS="as -arch i386"得到另一个错误.

Compiling:
as -arch i386 -o temp.o temp.s 
cc -g -o a.out -Wall temp.c `pkg-config --cflags --libs mono-2`  temp.o
ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/libmono-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file temp.o, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_mono_register_bundled_assemblies", referenced from:
      _mono_mkbundle_init in cczw6Dmo.o
  "_mono_set_dirs", referenced from:
      _main in cczw6Dmo.o
  "_mono_main", referenced from:
      _main in cczw6Dmo.o
  "_assembly_data_ser_exe", referenced from:
      _assembly_bundle_ser_exe in cczw6Dmo.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
[Fail]
Run Code Online (Sandbox Code Playgroud)

我看到这是32位/ 64位编译问题,那么如何删除此错误信息?我尝试过export CC="cc -arch i386",但它不起作用.

pro*_*eek 9

我不得不采取以下步骤.

  1. export AS ="as -arch i386"
  2. export CC ="cc -arch i386"
  3. 没有--static选项运行.只要运行mkbuild BINARY.使用选项--deps,它似乎嵌入了更多的dll.您可以使用-z选项压缩嵌入式库.

你可能会从更多的提示这个,和这个.Mono的mkbundle在解释.