Why can't I compile/run this non-CLR program in VC++ 2008?
How to do it?
MyProgram.cpp
#include <iostream>
namespace System
{
public class Console
{
public:
static void WriteLine(char str[])
{
std::cout<<str;
}
};
}
int main()
{
System::Console::WriteLine("This a non-CLR program!");
}
Error
Error 1 error C3381:
'System::Console' : assembly access specifiers are only
available in code compiled with a /clr option
e:\...\MyProgram.cpp 6