RTC1 and /clr options are incompatible:

A

Aldi

Hi,
Thanks for the privious response on /clr option.
Now that I have included /clr option another problem jumps up, and my
books do not show anything about these problems:
compiler: MS.net: VC++7.0
project: elementary using console


The error I get is:
hello3 Command line error D2016 : '/RTC1' and '/clr' command-line
options are incompatible
TIA for any suggestion,
Aldi

Following is the program I am running:
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;

__gc class animal
{
public:
animal(void);
virtual ~animal(void);
int legs;
void SetName(String *name)
{strName=strName->Copy(Name);}
String* GetName(){return strName;}
private:
String *strName;
};

int _tmain(int argc, _TCHAR* argv[])
{
Animal *cat, *dog ;
cat= new Animal;
dog= new Animal;

cat->SetName("Cat");
cat->legs=4;
dog->SetName("Dog");
dog->legs=4;
Console::WriteLine("Animal 1");
Console::Write("Name: ");
Console::WriteLine(Cat->GetName());
Console::Write("Legs: ");
Console::WriteLine(Cat->legs);
Console::WriteLine("Animal 2");
Console::Write("Name: ");
Console::WriteLine(Dog->GetName());
Console::Write("Legs: ");
Console::WriteLine(Dog->legs);
Console::WriteLine();

return 0;
}
 
W

William DePalo [MVP VC++]

Aldi said:
The error I get is:
hello3 Command line error D2016 : '/RTC1' and '/clr' command-line
options are incompatible
TIA for any suggestion,

Initially you created a "native", aka "unmanaged" project. The IDE picked a
set (a large set) of default options. Manually, you switched to a "managed"
project. The IDE did not change any of the previously set options.

Manually you can choose Properties from the Project menu again. Click on the
C++ "folder" in the left pain, then select the Code Generation options. In
the right pane look for the box labeled "Basic runtime checks" and choose
another option.

Alternatively, it you recreate the project selecting a .Net project type
then the IDE will choose a reasonable set of options for you.

Regards,
Will
 

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