wsaData : undeclared identifier

Reply

Join Date: Jul 2003
Posts: 58
Reputation: fakespike is an unknown quantity at this point 
Solved Threads: 0
fakespike fakespike is offline Offline
Junior Poster in Training

wsaData : undeclared identifier

 
0
  #1
Sep 28th, 2003
i get a error that i cant figure out any help?

void main()
{
// Initialize WinSock
int wsaret=WSAStartup(0x101,&wsaData);
if(wsaret)
return;
//Create the SOCKET

SOCKET conn;
conn=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(conn==INVALID_SOCKET)
return;

//clean up mess
closesocket(conn);
WSACleanup();
}

i get this error:

wsaData : undeclared identifier

any help
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 129
Reputation: Bob is an unknown quantity at this point 
Solved Threads: 1
Team Colleague
Bob Bob is offline Offline
Team Member

Re: wsaData : undeclared identifier

 
0
  #2
Oct 4th, 2003
Hard to say exactly, as you don't appear to have posted the complete compileable code that exhibits your problem.

> void main()
>{
>// Initialize WinSock
> int wsaret=WSAStartup(0x101,&wsaData);

You use wsaData in the line above. Where is it declared? Is it somewhere before main() is called, or does it exist in a header file somewhere that is (or is supposed to be) included by your program?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,036
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is online now Online
The Queen of DaniWeb

Re: wsaData : undeclared identifier

 
0
  #3
Oct 4th, 2003
This was part of a duplicate post. More information is available at http://www.daniweb.com/forums/thread1183.html
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 129
Reputation: Bob is an unknown quantity at this point 
Solved Threads: 1
Team Colleague
Bob Bob is offline Offline
Team Member

Re: wsaData : undeclared identifier

 
0
  #4
Oct 4th, 2003
I came across the following code that you posted in a different thread. Here wsaData is declared in the line I've highlighted:
#include <winsock.h>
#include <wsipx.h>
#include <wsnwlink.h>
#include <stdio.h>

int main()
{
////////////////
// Initialize windows sockets API.
//
WORD wVersionRequested = MAKEWORD(1, 1);
WSADATA wsaData;
if (WSAStartup(wVersionRequested, &wsaData)) {

Compare that with your post in this thread.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC