Click to See Complete Forum and Search --> : Error 1190
jame
February 5th, 2005, 06:01 PM
I keep getting fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option. Any help out there? #include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
// Ask for a name
String GetName()
{
Console::WriteLine(S"Enter your name");
Name = Console::ReadLine();
return(Name);
}
void DisplayName(Name)
{
console::WriteLine(S"So our name is {0}", Name);
return;
}
int main()
{
Name = GetName();
void DisplayName(Name);
return 0;
}
Mick
February 5th, 2005, 07:11 PM
Do you have /clr turned on in your project properties->General->[common runtime lanquage support]
Or if your using the toollkit you need to pass /clr.
jame
February 6th, 2005, 10:44 AM
Thanks I'll check.
jame
February 7th, 2005, 09:21 PM
[QUOTE]If I add /clr I get the error /ML not valid. Am I using the wrong template. I use Visual C++ under Project Types: and Win 32 Project under Template ioth console checked
Mick
February 7th, 2005, 09:36 PM
[QUOTE]If I add /clr I get the error /ML not valid. Am I using the wrong template. I use Visual C++ under Project Types: and Win 32 Project under Template ioth console checked
Depends on what you are doing :) The template you have selected is a win32 console application [no managed code support]. If you want to use managed code you have to make some changes to the settings [like setting under c++->code generation->run time library [Multi threaded debug DLL (for debug builds] Multi threaded DLL (for release builds).
So I would advise you to create a new project using the .NET console template. Then fix your code as you have some typos and incorrect usage.
jame
February 10th, 2005, 12:15 PM
Thanks Mick I'll get it right one day.
Mick
February 10th, 2005, 08:40 PM
Thanks Mick I'll get it right one day.
Well if this is all new to you then don't sweat it. It just takes time and patience. Use your local MSDN help and read the various topics in your spare time to get a feel for the components that the IDE brings together.
Here is a link to the on-line documentation from [msdn.microsoft.com] MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/vsnetanchor.asp)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.