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
William DePalo [MVP VC++] - 04 Jul 2004 20:56 GMT
> 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
Markus Palme - 04 Jul 2004 22:17 GMT
> So I defined a class I created as __gc type and also I included
> <mscorlib.dll>
[quoted text clipped - 3 lines]
> 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