newbie help ?? -> mscorlib.dll

  • Thread starter Thread starter beaTTech
  • Start date Start date
B

beaTTech

The other day i tried my first bit of c++. I was writing a really
small program,something like this:


#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

int _tmain()
{

Console::WriteLine("Hi");
return 0;
}

Which i know is simple but i still get this error ....

`fatal error C1190: managed targeted code requires '#using
<mscorlib.dll>' and '/clr' option`

is there something wrong with my visual studio or me..?

Im using visual studio .NET 2003 arch
 
beaTTech said:
The other day i tried my first bit of c++. I was writing a really
small program,something like this:


#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

int _tmain()
{

Console::WriteLine("Hi");
return 0;
}

Which i know is simple but i still get this error ....

`fatal error C1190: managed targeted code requires '#using
<mscorlib.dll>' and '/clr' option`

is there something wrong with my visual studio or me..?

You didn't choose a .NET project type, so you're lacking the /clr option
when VS runs the compiler.

Make a new project by choosing File|New|Project... from the menu then in the
new project dialog, locate "Visual C++ Projects" in the tree-view, expand it
if necessary. Click on ".NET" in the (second level of the) tree view.
Choose "Console Application" from the List View on the right. You probably
made a "Win32 Console Project" before.

-cd
 
Hi
i have the same problem and i solve it in the following way:
1) Go To ---Project Property->Configuration Property --->c/c++ --->/clr
2) Go To ---Project Property->Configuration Property --->Code Generation-->Basic Runtime Checks-->Defaults
3) Go To ---Project Property->Configuration Property --->Code Generation-->Enable Minimal Rebuild--> No
4) Go To ---Project Property->Configuration Property --->c/c++ -->General-->Debug Information Format-->Program Database (/Zi)
5) Go To ---Project Property->Configuration Property --->Code Generation-->Runtime Library--><inherit from project defaults>

those settings solve the problem
try it.
but remember its change the entire project property
have a nice day
Gabi
 
Back
Top