/clr option

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
 
W

William DePalo [MVP VC++]

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
 
M

Markus Palme

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
 

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

Similar Threads


Top