fatal error C1190 in VC++ .NET

Hello,

I am gettin a fatal error C1190 when I try to compile the code and run
it. Could anyone provide a solution for that? I guess I need to set the
/clr switch.

Here is the error:

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

It points to the syntax on code:

#using <mscorlib.dll>

<Yeah the third line of my code!!!!> ;-)

Would appreciate if anyone cud provide a solution for this! :-)

Thanks a much!

Karthik

[618 byte] By [Karthik.T] at [2007-12-16]
# 1
In VS.NET 2005 you can set the level of CLR support in the projects properties under Configuration Properties -> General, set Common Language Runtime Support to the approciate value (e.g. "Pure MSIL Common Language Runtime Support (/clr:pure)").

hth,
-- b.gr

BjoernGraf at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Hello Bjoern,

I am using VS.NET 2003 Sad and I was not able to find the CLR support Tongue Tied in the tab you had mentioned. Any other way to solve this bug?

Thanks again!

Karthik

Karthik.T at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 3
Yep, in VS.NET 2003 it is in the same location and the property is named Use Maned Extensions (a simple yes/no thing).

hth,
-- b.gr

BjoernGraf at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 4

gr8 thnx Bjoern!!!!

but now I got another error... Sad

I got a command line error while I was compiling my VC++ .NET code...

Error D2016 : '/stdafx.h' and '/clr' command-line options are incompatible

Prior to this I got an error "Run Time Checks" and /clr are incompatible... set the Maned Extensions field... and I set the Basic Run time = "0" using the text pad editor... on the .vcproj file...

I googled this error and I wasn't able to find a solution for this one.... rather could not find a BUG reported of this kind!!!

Any thoughts on this?

Thanx a million!!!

Karthik

Karthik.T at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 5
/stdafx.h is used for precompiled headers, the options should be in the C/C++ branch of the projects options (Precompiled Headers section).

Run Time Checks related options are located in C/C++ -> Code Generation.

-- b.gr

P.S.: A better forum for this thread would've been the C++ one ;)

BjoernGraf at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 6
Thnx a much! Bjoern!

I set the field, "Create/Use PCH through file" as StdAfx.h... Still its popping the same error!..

Any idea on what parameters I should set?
probably after your reply to this, I will take this thread to C/C++ forum. I thought since this code is on .NET framework, I posted my query here!!!

anyways.. thanks for ur suggestion! :-)

Karthik

Karthik.T at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified