Mono
June 6, 2022Less than 1 minute
Mono
Github:https://github.com/BanMing/mono
编译
不使用cygwin,直接使用vs2017以上的版本
https://www.mono-project.com/docs/compiling-mono/windows/no-cygwin/
注意:需要使用vs打开一下,并且更新一下Build target。
msbuild msvc\mono.sln /p:Platform=x64 /p:Configuration=Release /p:MONO_TARGET_GC=sgen
编译32位-bdwgc
msbuild msvc\mono.sln /p:Platform=Win32 /p:Configuration=Release /p:MONO_TARGET_GC=bdwgc
编译64位-bdwgc
msbuild msvc\mono.sln /p:Platform=x64 /p:Configuration=Release /p:MONO_TARGET_GC=bdwgc
修改读取dll
/**
* mono_image_open_from_data_with_name:
*/
MonoImage *
mono_image_open_from_data_with_name (char *data, guint32 data_len, gboolean need_copy, MonoImageOpenStatus *status, gboolean refonly, const char *name)
{
if (strstr (name, "Sample.dll") != NULL) {
guint32 offset = (guint32)strlen (name);
memcpy (data, data + offset, data_len - offset);
}
return mono_image_open_from_data_internal (data, data_len, need_copy, status, refonly, FALSE, name);
}