simple UDP client

shf75's Avatar, Join Date: Dec 2006
Newbie Member
I am trying to make a simple UDP ethernet client, that opens a socket, and sends
a packet to a specific server.
However, my Visual C++2005 gives me the following error :
fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
What does it want from me ? It seems also that I don't have the 'ws2_32.lib' .
What do I do ?
Does anyone have a simple client code ?
Thanks,
Sharon
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
When you downloaded the 2005 it instructed you to also download the platform SDK. Did you do that? Did you put those on your path? Your message is very clear: no such file or directory. One would presume that's what it wants from you.
0
shf75's Avatar, Join Date: Dec 2006
Newbie Member
Thanks.
Now it works.
However, when I try to activate a thread :
AfxBeginThread(ServerThread,0);

I get the error :

error C3861: 'AfxBeginThread': identifier not found

even though the <windows.h> and <WinSock2.h> are included.
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Have you configured your threading and "Use of MFC" options?
0
shf75's Avatar, Join Date: Dec 2006
Newbie Member
I guess not.
How do I go about doing this ?
Sharon
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
At some point, if you intend to be successful at this, you're going to have to develop some personal initiative and some resourcefulness. Missing the injunction to download the SDK is indicative; it's right in the instructions for downloading the 2005. Have you considered clicking the 'Help' button in 2005? It will allow you to search for configuration settings. One search term that happens to occur to me is "MFC." Another would be "threads." Have you considered entering "AfxBeginThread" into a Google search bar? Stuff like that. It's when you have been unable to resolve a problem after exercising due diligence (STFW, RTFM) that forums become really handy.

You can also get better responses if you include a small snippet of code that exhibits the problem. It's good to include the exact error message, as you did, and the line at which it erupted. Often, however, the error is caused by something earlier. When the compiler finally figures out the totality isn't going to be correct, it will then flag an error. Examples are missing semicolons, undefined types, etc. Information is key, both for you and for potential respondents.