mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 15 Jan 2012 11:40 AM |
I get an error whenever I try to build something with
using namespace System;
in it.
Can anyone help? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
| |
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 15 Jan 2012 12:01 PM |
"an error"
That's not very useful. What error? Are you sure System is actually a namespace? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 15 Jan 2012 12:03 PM |
| It says that System is not a valid namespace, even though I DID include System.dll |
|
|
| Report Abuse |
|
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 15 Jan 2012 12:05 PM |
"include System.dll"
You don't "include" dlls. Exactly what did you do to "include" it? (Also, what library is System.dll of?) |
|
|
| Report Abuse |
|
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 15 Jan 2012 12:06 PM |
| Perhaps this fellow is using a sort of managed C++? |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 15 Jan 2012 12:07 PM |
.NET
and I went to
Project > [Project] Properties > Add New Reference > .NET > System.dll |
|
|
| Report Abuse |
|
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
| |
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
| |
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 15 Jan 2012 12:12 PM |
| There's probably some header file (.h) you need to use the #include statement with. |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 15 Jan 2012 12:18 PM |
| What do I need to include? |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2012 12:18 PM |
make a header file including that stuff
then include the header file
like varp said that sounds correct |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 15 Jan 2012 12:20 PM |
That's C# and in C# it's:
using System; |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 15 Jan 2012 12:33 PM |
Myrco, I know how2C#
I'm learning how2C++ |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 15 Jan 2012 01:12 PM |
You can't just use the .NET DLL straight with C++. There needs to be a header file to tell the C++ compiler what functions are available in the DLL, and what their APIs (argument and return value types) are.
Also, I doubt that you can even use the C# "System" library with C++. There's different APIs for C++, at least in the current version of Windows (In Windows8 MS is looking to unify the APIs that C++ and C# code use). |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 15 Jan 2012 02:17 PM |
"Also, I doubt that you can even use the C# "System" library with C++."
You can't, as far as I know without using C++/CLI which is a mash of new operators and keywords that really don't make no sense. I mean '^' as a 'top level operator' or whatever that's supposed to mean and whatever else they added? Really? Just to get .NET working? |
|
|
| Report Abuse |
|
|