Why C++/CLI compiler can compile this code:
using namespace System;
inline void Assembly(){
__asm{
mov eax,5
}
}
int main(array<System::String ^> ^args)
{
Assembly();
Console::WriteLine(L"Hello World");
return 0;
}
And can NOT for this one:
using namespace System;
int main(array<System::String ^> ^args)
{
__asm{
mov eax,5
}
Console::WriteLine(L"Hello World");
return 0;
}
Error 1 error C3644: 'main' : cannot compile the function to generate managed code. - Aan