newbie help ?? -> mscorlib.dll

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
 
C

Carl Daniel [VC++ MVP]

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top