编译并集成mono 2.6.4到应用程序中


一,首先从mono的svn中获取mono 2.64分支到MonoSrc目录下.

二,编译mono核心库:
1,打开mono\msvc05中的mono.sln,选择Release_eglib配置
2,将libmono的pdb输出名改为mono_dll.pdb,避免和mono.exe重名.
3,将mono-semaphore.c和mono-basic-block.c添加到libmono中,build


三,编译teste:
1,注掉teste.c中的#include <mono/jit/jit.h>,  
  在main的mono_config_parse调用前面加入mono_set_dirs("lib\\", "etc\\");
  在main的return retval;之前加入 printf("Press any to continue..."); getch();
  生成teste.exe。

2,项目设置中的include中加入..\;..\..\mono\eglib\src,  lib中加入mono.lib
3,测试teste:
   <1>下载并安装mono2.64 预编译好的开发环境到D:\Mono-2.6.4下.
   <2>将"D:\Mono-2.6.4\bin"加入环境变量
   <3>在MonoSrc\mono\samples\embed下创建run.bat内容为"gmcs test.cs"保存,运行并将生成的test.exe拷贝到
      MonoSrc\mono\msvc05\Win32_Release_eglib\bin下.
   <4>将D:\Mono-2.6.4\etc目录拷贝到MonoSrc\mono\msvc05\Win32_Release_eglib\bin中.
   <5>将D:\Mono-2.6.4\lib\mono\2.0目录拷贝到MonoSrc\mono\msvc05\Win32_Release_eglib\lib\mono中.
   <6>在MonoSrc\mono\msvc05\Win32_Release_eglib\bin中创建run_teste.bat,内容为"teste test.exe", 运行,输出为:
      "All your monos are belong to us!"
      测试通过!!!!!!
   

posted on 2010-06-20 22:48  chunlin  阅读(926)  评论(1编辑  收藏  举报

导航