EDN Admin
Well-known member
Hello
how to solve problem with application compilation
Error 9 error LNK2001: unresolved external symbol __alloca c:Userssmerkurievdocumentsvisual studio 2010ProjectsEmbeddingMonoEmbeddingMonolibmono.a(exceptions-x86.o) EmbeddingMono
Project and source code
<div style="color:Black;background-color:White; <pre>
#include <span style="color:#A31515; "stdafx.h"
#include <span style="color:#A31515; "glib.h"
#include <span style="color:#A31515; "mono/jit/jit.h"
#include <span style="color:#A31515; "mono/metadata/assembly.h"
#include <mono/metadata/debug-helpers.h>
<span style="color:Blue; int _tmain(<span style="color:Blue; int argc, _TCHAR* argv[])
{
MonoDomain *domain;
MonoAssembly *assembly;
<span style="color:Green; //domain = mono_jit_init ("myapp");
domain = mono_jit_init_version (<span style="color:#A31515; "myapp", <span style="color:#A31515; "v2.0.50727");
assembly = mono_domain_assembly_open (domain, <span style="color:#A31515; "C:\Projects\TestApp\TestApp.exe");
<span style="color:Blue; if (!assembly)
{
<span style="color:Blue; return 1;
}
MonoImage *monoImage = mono_assembly_get_image (assembly);
MonoClass *monoClass = mono_class_from_name (monoImage, <span style="color:#A31515; "TestApp", <span style="color:#A31515; "TestClass");
MonoMethodDesc* monoMethodDesc = mono_method_desc_new (<span style="color:#A31515; "System.Object:GetHashCode()", <span style="color:Blue; true);
MonoMethod* monoMethod = mono_method_desc_search_in_class (monoMethodDesc, monoClass);
MonoObject *monoObject = mono_object_new (domain, monoClass);
mono_runtime_object_init (monoObject);
<span style="color:Blue; return 0;
}
[/code]
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <?<span style="color:#A31515; xml <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1.0<span style="color:Black; " <span style="color:Red; encoding<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; utf-8<span style="color:Black; "<span style="color:Blue; ?>
<span style="color:Blue; <<span style="color:#A31515; Project <span style="color:Red; DefaultTargets<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Build<span style="color:Black; " <span style="color:Red; ToolsVersion<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 4.0<span style="color:Black; " <span style="color:Red; xmlns<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/developer/msbuild/2003<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ProjectConfigurations<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectConfiguration <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Configuration<span style="color:Blue; >Debug<span style="color:Blue; </<span style="color:#A31515; Configuration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Platform<span style="color:Blue; >Win32<span style="color:Blue; </<span style="color:#A31515; Platform<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ProjectConfiguration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectConfiguration <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Configuration<span style="color:Blue; >Release<span style="color:Blue; </<span style="color:#A31515; Configuration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Platform<span style="color:Blue; >Win32<span style="color:Blue; </<span style="color:#A31515; Platform<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ProjectConfiguration<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Globals<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectGuid<span style="color:Blue; >{27D597AF-0D48-4C3F-B38C-1F0C4E0D5649}<span style="color:Blue; </<span style="color:#A31515; ProjectGuid<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Keyword<span style="color:Blue; >Win32Proj<span style="color:Blue; </<span style="color:#A31515; Keyword<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; RootNamespace<span style="color:Blue; >EmbeddingMono<span style="color:Blue; </<span style="color:#A31515; RootNamespace<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.Default.props<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Configuration<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ConfigurationType<span style="color:Blue; >Application<span style="color:Blue; </<span style="color:#A31515; ConfigurationType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; CharacterSet<span style="color:Blue; >Unicode<span style="color:Blue; </<span style="color:#A31515; CharacterSet<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Configuration<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ConfigurationType<span style="color:Blue; >Application<span style="color:Blue; </<span style="color:#A31515; ConfigurationType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >false<span style="color:Blue; </<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WholeProgramOptimization<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; WholeProgramOptimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; CharacterSet<span style="color:Blue; >Unicode<span style="color:Blue; </<span style="color:#A31515; CharacterSet<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.props<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ExtensionSettings<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PropertySheets<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(UserRootDir)Microsoft.Cpp.$(Platform).user.props<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; exists($(UserRootDir)Microsoft.Cpp.$(Platform).user.props)<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; LocalAppDataPlatform<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PropertySheets<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(UserRootDir)Microsoft.Cpp.$(Platform).user.props<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; exists($(UserRootDir)Microsoft.Cpp.$(Platform).user.props)<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; LocalAppDataPlatform<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; UserMacros<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LinkIncremental<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; LinkIncremental<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LinkIncremental<span style="color:Blue; >false<span style="color:Blue; </<span style="color:#A31515; LinkIncremental<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemDefinitionGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >Use<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WarningLevel<span style="color:Blue; >Level3<span style="color:Blue; </<span style="color:#A31515; WarningLevel<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Optimization<span style="color:Blue; >Disabled<span style="color:Blue; </<span style="color:#A31515; Optimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)<span style="color:Blue; </<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalIncludeDirectories<span style="color:Blue; >Crogram FilesMono-2.6.7includemono-1.0;Crogram FilesMono-2.6.7libglib-2.0include;Crogram FilesMono-2.6.7includeglib-2.0glib;Crogram FilesMono-2.6.7includeglib-2.0;Crogram FilesMono-2.6.7include;%(AdditionalIncludeDirectories)<span style="color:Blue; </<span style="color:#A31515; AdditionalIncludeDirectories<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; BasicRuntimeChecks<span style="color:Blue; >Default<span style="color:Blue; </<span style="color:#A31515; BasicRuntimeChecks<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; MinimalRebuild<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; MinimalRebuild<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ExceptionHandling<span style="color:Blue; >SyncCThrow<span style="color:Blue; </<span style="color:#A31515; ExceptionHandling<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DebugInformationFormat<span style="color:Blue; >EditAndContinue<span style="color:Blue; </<span style="color:#A31515; DebugInformationFormat<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SubSystem<span style="color:Blue; >Console<span style="color:Blue; </<span style="color:#A31515; SubSystem<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalLibraryDirectories<span style="color:Blue; >Crogram FilesMono-2.6.7lib;%(AdditionalLibraryDirectories)<span style="color:Blue; </<span style="color:#A31515; AdditionalLibraryDirectories<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalDependencies<span style="color:Blue; >glib-2.0.lib;libmono.a;libmono.dll.a;msvcrt.lib;oldnames.lib;kernel32.lib;ws2_32.lib;mswsock.lib;advapi32.lib;%(AdditionalDependencies)<span style="color:Blue; </<span style="color:#A31515; AdditionalDependencies<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemDefinitionGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemDefinitionGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WarningLevel<span style="color:Blue; >Level3<span style="color:Blue; </<span style="color:#A31515; WarningLevel<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >Use<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Optimization<span style="color:Blue; >MaxSpeed<span style="color:Blue; </<span style="color:#A31515; Optimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; FunctionLevelLinking<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; FunctionLevelLinking<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; IntrinsicFunctions<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; IntrinsicFunctions<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)<span style="color:Blue; </<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SubSystem<span style="color:Blue; >Console<span style="color:Blue; </<span style="color:#A31515; SubSystem<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; EnableCOMDATFolding<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; EnableCOMDATFolding<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; OptimizeReferences<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; OptimizeReferences<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemDefinitionGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; None <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ReadMe.txt<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClInclude <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; stdafx.h<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ClInclude <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; targetver.h<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; EmbeddingMono.cpp<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ClCompile <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; stdafx.cpp<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >Create<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >Create<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.targets<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ExtensionTargets<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Project<span style="color:Blue; >
[/code]
View the full article
how to solve problem with application compilation
Error 9 error LNK2001: unresolved external symbol __alloca c:Userssmerkurievdocumentsvisual studio 2010ProjectsEmbeddingMonoEmbeddingMonolibmono.a(exceptions-x86.o) EmbeddingMono
Project and source code
<div style="color:Black;background-color:White; <pre>
#include <span style="color:#A31515; "stdafx.h"
#include <span style="color:#A31515; "glib.h"
#include <span style="color:#A31515; "mono/jit/jit.h"
#include <span style="color:#A31515; "mono/metadata/assembly.h"
#include <mono/metadata/debug-helpers.h>
<span style="color:Blue; int _tmain(<span style="color:Blue; int argc, _TCHAR* argv[])
{
MonoDomain *domain;
MonoAssembly *assembly;
<span style="color:Green; //domain = mono_jit_init ("myapp");
domain = mono_jit_init_version (<span style="color:#A31515; "myapp", <span style="color:#A31515; "v2.0.50727");
assembly = mono_domain_assembly_open (domain, <span style="color:#A31515; "C:\Projects\TestApp\TestApp.exe");
<span style="color:Blue; if (!assembly)
{
<span style="color:Blue; return 1;
}
MonoImage *monoImage = mono_assembly_get_image (assembly);
MonoClass *monoClass = mono_class_from_name (monoImage, <span style="color:#A31515; "TestApp", <span style="color:#A31515; "TestClass");
MonoMethodDesc* monoMethodDesc = mono_method_desc_new (<span style="color:#A31515; "System.Object:GetHashCode()", <span style="color:Blue; true);
MonoMethod* monoMethod = mono_method_desc_search_in_class (monoMethodDesc, monoClass);
MonoObject *monoObject = mono_object_new (domain, monoClass);
mono_runtime_object_init (monoObject);
<span style="color:Blue; return 0;
}
[/code]
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <?<span style="color:#A31515; xml <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1.0<span style="color:Black; " <span style="color:Red; encoding<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; utf-8<span style="color:Black; "<span style="color:Blue; ?>
<span style="color:Blue; <<span style="color:#A31515; Project <span style="color:Red; DefaultTargets<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Build<span style="color:Black; " <span style="color:Red; ToolsVersion<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 4.0<span style="color:Black; " <span style="color:Red; xmlns<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; http://schemas.microsoft.com/developer/msbuild/2003<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ProjectConfigurations<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectConfiguration <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Configuration<span style="color:Blue; >Debug<span style="color:Blue; </<span style="color:#A31515; Configuration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Platform<span style="color:Blue; >Win32<span style="color:Blue; </<span style="color:#A31515; Platform<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ProjectConfiguration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectConfiguration <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Configuration<span style="color:Blue; >Release<span style="color:Blue; </<span style="color:#A31515; Configuration<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Platform<span style="color:Blue; >Win32<span style="color:Blue; </<span style="color:#A31515; Platform<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ProjectConfiguration<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Globals<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ProjectGuid<span style="color:Blue; >{27D597AF-0D48-4C3F-B38C-1F0C4E0D5649}<span style="color:Blue; </<span style="color:#A31515; ProjectGuid<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Keyword<span style="color:Blue; >Win32Proj<span style="color:Blue; </<span style="color:#A31515; Keyword<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; RootNamespace<span style="color:Blue; >EmbeddingMono<span style="color:Blue; </<span style="color:#A31515; RootNamespace<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.Default.props<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Configuration<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ConfigurationType<span style="color:Blue; >Application<span style="color:Blue; </<span style="color:#A31515; ConfigurationType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; CharacterSet<span style="color:Blue; >Unicode<span style="color:Blue; </<span style="color:#A31515; CharacterSet<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; Configuration<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ConfigurationType<span style="color:Blue; >Application<span style="color:Blue; </<span style="color:#A31515; ConfigurationType<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >false<span style="color:Blue; </<span style="color:#A31515; UseDebugLibraries<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WholeProgramOptimization<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; WholeProgramOptimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; CharacterSet<span style="color:Blue; >Unicode<span style="color:Blue; </<span style="color:#A31515; CharacterSet<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.props<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ExtensionSettings<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PropertySheets<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(UserRootDir)Microsoft.Cpp.$(Platform).user.props<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; exists($(UserRootDir)Microsoft.Cpp.$(Platform).user.props)<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; LocalAppDataPlatform<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; PropertySheets<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(UserRootDir)Microsoft.Cpp.$(Platform).user.props<span style="color:Black; " <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; exists($(UserRootDir)Microsoft.Cpp.$(Platform).user.props)<span style="color:Black; " <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; LocalAppDataPlatform<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; UserMacros<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LinkIncremental<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; LinkIncremental<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PropertyGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; LinkIncremental<span style="color:Blue; >false<span style="color:Blue; </<span style="color:#A31515; LinkIncremental<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; PropertyGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemDefinitionGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >Use<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WarningLevel<span style="color:Blue; >Level3<span style="color:Blue; </<span style="color:#A31515; WarningLevel<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Optimization<span style="color:Blue; >Disabled<span style="color:Blue; </<span style="color:#A31515; Optimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)<span style="color:Blue; </<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalIncludeDirectories<span style="color:Blue; >Crogram FilesMono-2.6.7includemono-1.0;Crogram FilesMono-2.6.7libglib-2.0include;Crogram FilesMono-2.6.7includeglib-2.0glib;Crogram FilesMono-2.6.7includeglib-2.0;Crogram FilesMono-2.6.7include;%(AdditionalIncludeDirectories)<span style="color:Blue; </<span style="color:#A31515; AdditionalIncludeDirectories<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; BasicRuntimeChecks<span style="color:Blue; >Default<span style="color:Blue; </<span style="color:#A31515; BasicRuntimeChecks<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; MinimalRebuild<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; MinimalRebuild<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ExceptionHandling<span style="color:Blue; >SyncCThrow<span style="color:Blue; </<span style="color:#A31515; ExceptionHandling<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; DebugInformationFormat<span style="color:Blue; >EditAndContinue<span style="color:Blue; </<span style="color:#A31515; DebugInformationFormat<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SubSystem<span style="color:Blue; >Console<span style="color:Blue; </<span style="color:#A31515; SubSystem<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalLibraryDirectories<span style="color:Blue; >Crogram FilesMono-2.6.7lib;%(AdditionalLibraryDirectories)<span style="color:Blue; </<span style="color:#A31515; AdditionalLibraryDirectories<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AdditionalDependencies<span style="color:Blue; >glib-2.0.lib;libmono.a;libmono.dll.a;msvcrt.lib;oldnames.lib;kernel32.lib;ws2_32.lib;mswsock.lib;advapi32.lib;%(AdditionalDependencies)<span style="color:Blue; </<span style="color:#A31515; AdditionalDependencies<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemDefinitionGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemDefinitionGroup <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; WarningLevel<span style="color:Blue; >Level3<span style="color:Blue; </<span style="color:#A31515; WarningLevel<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >Use<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Optimization<span style="color:Blue; >MaxSpeed<span style="color:Blue; </<span style="color:#A31515; Optimization<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; FunctionLevelLinking<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; FunctionLevelLinking<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; IntrinsicFunctions<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; IntrinsicFunctions<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)<span style="color:Blue; </<span style="color:#A31515; PreprocessorDefinitions<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SubSystem<span style="color:Blue; >Console<span style="color:Blue; </<span style="color:#A31515; SubSystem<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; GenerateDebugInformation<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; EnableCOMDATFolding<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; EnableCOMDATFolding<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; OptimizeReferences<span style="color:Blue; >true<span style="color:Blue; </<span style="color:#A31515; OptimizeReferences<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Link<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemDefinitionGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; None <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ReadMe.txt<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClInclude <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; stdafx.h<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ClInclude <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; targetver.h<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; ClCompile <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; EmbeddingMono.cpp<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ClCompile <span style="color:Red; Include<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; stdafx.cpp<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Debug|Win32<span style="color:Black; "<span style="color:Blue; >Create<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; PrecompiledHeader <span style="color:Red; Condition<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(Configuration)|$(Platform)==Release|Win32<span style="color:Black; "<span style="color:Blue; >Create<span style="color:Blue; </<span style="color:#A31515; PrecompiledHeader<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ClCompile<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ItemGroup<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Import <span style="color:Red; Project<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; $(VCTargetsPath)Microsoft.Cpp.targets<span style="color:Black; " <span style="color:Blue; />
<span style="color:Blue; <<span style="color:#A31515; ImportGroup <span style="color:Red; Label<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ExtensionTargets<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; ImportGroup<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Project<span style="color:Blue; >
[/code]
View the full article