473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

"mscorlib.dll" Problem

Hey,
I just downloaded Visual C++ 2005 Express, and I'm reading through a
book called "Visual C++ .NET Step By Step", which was made for 2003.
Just so you know where I'm getting this example.

When I build this code, I get the following compile error.

1>c:\documents and settings\editing\my
documents\alex\c++\animal\animal\animal.cpp(6) : fatal error C1190:
managed targeted code requires a '/clr' option

And that is regarding this:

#using <mscorlib.dll>

And then when I had /clr to the options, it then says:

1>cl : Command line error D8016 : '/RTC1' and '/clr' command-line
options are incompatible

So if I shut off /RTC1 in code generation, then it just says that
therer is another thing incompatible (/Gm I think) and it just keeps
going on with incompatibilities. Is there any way that I can make this
code work?

////////////////////////////////////////////////////////////////////////

// Animal.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

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

};

int _tmain()
{
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::Write(cat->legs);

return 0;

}

//////////////////////////////////////////////////////

I am using a regular Win32 console applications. Thanks alot.

Dec 18 '05 #1
2 5918
"Alex Hardin" <61**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I just downloaded Visual C++ 2005 Express, ...
When I build this code, I get the following compile error.

1>c:\documents and settings\editing\my
documents\alex\c++\animal\animal\animal.cpp(6) : fatal error C1190:
managed targeted code requires a '/clr' option
...
1>cl : Command line error D8016 : '/RTC1' and '/clr' command-line
options are incompatible

So if I shut off /RTC1 in code generation, then it just says that
therer is another thing incompatible (/Gm I think) and it just keeps
going on with incompatibilities. Is there any way that I can make this
code work?


You have two choices, easy and hard.

The hard way is to come up to speed on the meaning of the compiler options,
understand the incompatibilities and then set the switches appropriately for
your project.

The easy way is to have the wizard generate a project for you and then add
your source (files) to that project.

I don't have the Express Edition loaded here, but when I choose
File->New->Project from the Professional menu, under the C++ project types
there is a CLR choice. If I select that, in the right pane there is a "CLR
Console Application" template. If you are doing ordinary character mode
screen I/O (i.e. no windows) then this is the template you want. Type a name
for your project and click OK

The IDE will create a main() function for you which you can edit..

Just by the way, this is the command line that the IDE uses to build the
project:

/Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd
/Yu"stdafx.h" /Fp"Debug\test.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3
/nologo /c /Zi /clr /TP /errorReport:prompt /FU
"c:\Windows\Microsoft.NET\Framework\v2.0.50727\Sys tem.dll" /FU
"c:\Windows\Microsoft.NET\Framework\v2.0.50727\Sys tem.Data.dll" /FU
"c:\Windows\Microsoft.NET\Framework\v2.0.50727\Sys tem.XML.dll"

Regards,
Will

Dec 18 '05 #2
Hey, thanks alot! That and a combination of other things worked.
Learning what on earth CLR and managed C++ is really helped ;) Thanks
again!

Dec 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Giles Brown | last post by:
I'm feeling quite dumb this morning. I'm trying to build a COM server DLL using py2exe and it ain't working. Here's what ain't working... setup_dll.py based on py2exe sample: """from...
1
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an...
4
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a...
5
by: ron jacobs | last post by:
I have just implemented a "mixed mode" dll in VC++. I have implemented this dll in accordence with several articles found on the MSDN website including KB 814472. The crux of the problem is that...
3
by: Dmitry Jouravlev | last post by:
Hi, I have a number of C++ solutions in Visual Studio .NET and when i compile them using "Whole Program Optimization", certain projects report a LNK1171 error saying that c2.dll could not be...
5
by: Francesc | last post by:
Hi, I'm programming some classes in order to be able to import different text formats (TXT, RTF, HTML, ...) to my own format called RUF. I've defined one Solution within several Projects, each...
0
by: jiabin | last post by:
Hi, I got an exception with the message below, when I'm trying to start my application. "Could not load a type. Failed to partially bind to "System.String, mscorlib". " I did a search on...
4
by: topmind | last post by:
I tried to install the sqlite extension to PHP using "php_sqlite.dll", but I get the following error message: PHP Warning: Unknown(): Unable to load dynamic library './php_sqlite.dll' - Access...
0
by: raludamian | last post by:
Hello! I'm trying to develop a GIS mapping software on smart devices (Pocket PC) using VS 2005, C#. I need to use a library that was written in C++. Being open source I compiled the C++ code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.