Click to See Complete Forum and Search --> : System.Net namespace
kodeguruguy
April 16th, 2004, 02:34 PM
I'm trying to use the System.Net namsepace since it's required for the IPHostEntry class, but when I declare using namspace System.Net, I get an error. Am I not declaring this right or what's wrong?
Thanks
Andreas Masur
April 16th, 2004, 02:49 PM
[Moved thread]
kodeguruguy
April 16th, 2004, 04:29 PM
Why was my post moved? It's C++ related!
Andreas Masur
April 16th, 2004, 05:00 PM
Your post was moved to the appropriate forum since your question is dependent on the .NET framework.
Andreas Masur
April 16th, 2004, 05:01 PM
Furthermore...what kind of error do you get?
kodeguruguy
April 16th, 2004, 05:12 PM
Here are the errors I get:
C:\Documents and Settings\BekaryanA\My Documents\Micro-controller files\HWIL\HWIL.cpp(9) : error C2143: syntax error : missing ';' before '.'
C:\Documents and Settings\BekaryanA\My Documents\Micro-controller files\HWIL\HWIL.cpp(9) : error C2873: 'System' : symbol cannot be used in a using-declaration
C:\Documents and Settings\BekaryanA\My Documents\Micro-controller files\HWIL\HWIL.cpp(9) : error C2143: syntax error : missing ';' before '.'
where line(9) is where I have typed: using namespace System.Net;
Thanks for the response. This is the second time you moved my thread and I wasn't sure why (I'm new to the site).
Andreas Masur
April 16th, 2004, 05:33 PM
using namespace System::Net;
Andreas Masur
April 16th, 2004, 05:51 PM
Ooohh...and you need the correct assembly as well...thus
#using <System.dll>
using namespace System::Net;
I was thinking in terms of C# before which does it differently...sorry about that... :rolleyes:
kodeguruguy
April 20th, 2004, 02:17 PM
I tried what you suggested, but now I'm getting another error
fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
Would anyone happen to know the solution to this?
Thanks
TheCPUWizard
April 20th, 2004, 02:19 PM
You are trying to mix managed and unmanaged code. In general a bad idea, unless you REALLY know what you are doing.
alan93
May 18th, 2004, 11:57 AM
When I added:
#using <System.dll>
using namespace System::Net;
It asked for
mscorlib.dll
when I added that, it asked for compile option /clr
when I added that, it said /clr was incompatible with /Zd
no end in site,
any help appreciated
alan93
May 18th, 2004, 12:03 PM
Sytem.dll missing afer #using in previous post.
Message board not working correctly, not posting items in angle brackets
TheCPUWizard
May 18th, 2004, 12:35 PM
Allen,
As I stated before, you are trying to mix managed (which requires the /clr switch) and unmanaged (as indicated by the /Zd switch).
Unless you have a really solid grasp of all of the issues involved you should really stay with one or the other.
Either migrate your code to be managed (every class is __gc and all files compiled with /clr) or unmanaged (in which case you use the COM versions of interfaces).
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.