Mono 3.4.0 mkbundle under Mac OS X failed

后端 未结 2 516
予麋鹿
予麋鹿 2021-01-22 07:58

I`m trying to make static binary under MAC OS X 10.9 (Mavericks) which is not require mono runtime. This is almost clean machine with the latest updates and the latest XCode.

相关标签:
2条回答
  • 2021-01-22 08:17

    You need to link the binary with the CoreFoundation framework. This is a recent change in Mono 3.4 as per the Mono 3.4 release notes. A similar issue was reported a while ago.

    0 讨论(0)
  • 2021-01-22 08:31

    To clarify, you need to add the following to that last cc command:

    -framework CoreFoundation -lobjc -liconv 
    

    So in your case the command:

    cc -arch i386 -o client-patcher -Wall pkg-config --cflags mono-2 temp.c -lz pkg-config --libs-only-L mono-2 pkg-config --variable=libdir mono-2/libmono-2.0.a pkg-config --libs-only-l mono-2 | sed -e "s/\-lmono-2.0 //" temp.o
    

    Should be re-written with those flags in front of cc:

    cc -framework CoreFoundation -lobjc -liconv -arch i386 -o client-patcher -Wall pkg-config --cflags mono-2 temp.c -lz pkg-config --libs-only-L mono-2 pkg-config --variable=libdir mono-2/libmono-2.0.a pkg-config --libs-only-l mono-2 | sed -e "s/-lmono-2.0 //" temp.o

    Simply cut/paste that last cc command, add those flags to it, cut/paste back into the terminal, hit enter and enjoy.

    0 讨论(0)
提交回复
热议问题