Click to See Complete Forum and Search --> : error C2871: 'System' : a namespace with this name does not exist


chethanJasi
February 27th, 2008, 03:59 AM
Hi,
(description includes Reply from STLDude of codeguru member)
I have some issues while using SYSTEM NAMESPACE.

Mine is a C++ application running on .NET 2003

when ever i use

using namespace std;
using namespace System;
using namespace System::IO;

i get the error

error C2871: 'System' : a namespace with this name does not exist for using namespace System;

&
error C2653: 'System' : is not a class or namespace name for using namespace System::IO;

but i tried creating a new console application and it works fine.


Reply from STLDude
Member Join Date: May 2007, Posts: 294
Reputation:

Re: error C2871: 'System' : a namespace with this name does not exist

--------------------------------------------------------------------------------

This is not C++ but Managed C++ (clr) and thus needs to be specified in project properties at Configuration Properties/General/Common Language Runtime support. There you will see drop down box with options.


My Reply

Re: error C2871: 'System' : a namespace with this name does not exist

--------------------------------------------------------------------------------

I am not able to find Configuration Properties/General/Common Language Runtime support.

I searched the entier project property but failed to get the above setting.

i am using .NET2003 framework 1.1
and my application is C++


No, that isn't C++. It is Managed C++. If you need more help, there is a Managed C++ forum where you should ask further questions.

Regards,

Paul McKenzie

darwen
February 27th, 2008, 04:55 PM
The managed option is in the project settings - open solution explorer and right click on the project node (not the solution node i.e. the top one, the next one down). Select 'properties'.

In the 'general' tab find the option mentioned by STLDude.

Darwen.

STLDude
February 27th, 2008, 05:25 PM
In your original thread I posted correct path to options in VC++ 2003 which is slightly different from 2005.