/clr option

  • Thread starter Thread starter Aldi Kraja
  • Start date Start date
A

Aldi Kraja

Hi,
I am starting to follow a book which is saying to use common language
runtime (clr).
So I defined a class I created as __gc type and also I included
<mscorlib.dll>
but when I build the program the VC++ is saying
c:\aldi3\cpp\helloWorld\helloWorld.cpp(7): fatal error C1190: managed
targeted code requires '#using <mscorlib.dll>' and '/clr' option

The book does not show how to define clr option. How can I control to use
clr option?
Thanks,
Aldi
 
Aldi Kraja said:
but when I build the program the VC++ is saying
c:\aldi3\cpp\helloWorld\helloWorld.cpp(7): fatal error C1190: managed
targeted code requires '#using <mscorlib.dll>' and '/clr' option

The book does not show how to define clr option. How can I control to use
clr option?

From the Project menu choose the <project> Properties item. Under the
Configuration Properties yellow folder in the left pane click on General.
Then on the right side find the edit box labeled "Use Managed Extensions"
make sure it is set to Yes.

Regards,
Will
 
Aldi said:
So I defined a class I created as __gc type and also I included
<mscorlib.dll>
[...]
fatal error C1190: managed
targeted code requires '#using <mscorlib.dll>' and '/clr' option
The book does not show how to define clr option. How can I control to
use clr option?

Presuming you are using VisualStudio.NET: Open the project options,
select the "General" tab (should be visible by default) and set "Use
managed extensions" to true.

If you are compiling from the commandline you simply have to add the
"/clr" switch.

Regards
Markus
 
Back
Top