Advertisement

missing ';' before identifier...

Started by November 14, 2002 01:34 PM
5 comments, last by MainForze 22 years ago
I know this compiler error usually means that you forgot to end a statement with a '';'', but the header in which this error occurs is the first header included in the main source-file, and there are no statements before it! Here''s the header...

#ifndef WS_UTIL_H
#define WS_UTIL_H

#include <winsock.h>

SOCK EstablishConnection(hostent *pheHost, sockaddr_in *saHost, char *szHost, WORD wPort);
int RecvData(SOCK Socket, char *szBuffer);
int SendData(SOCK Socket, char *szBuffer);
int CancelConnection(SOCK Socket, bool bShutdown);

#endif // WS_UTIL_H
 
The identifier that the compiler thinks is missing an '';'' before it is EstablishConnection. I never checked, but I don''t think winsock.h misses a '';'' ;-). Any ideas?
"It's strange, isn't it? You stand in the middle of a library and go 'AAAAAAAGGHHHH' and everyone just stares at you. But you do the same thing on an airplane, and everyone joins in!"
I''m not sure....but is SOCK something?
Advertisement
Yup, SOCK is nothing but a int typedef''ed in winsock.h...

Any OTHER ideas?
"It's strange, isn't it? You stand in the middle of a library and go 'AAAAAAAGGHHHH' and everyone just stares at you. But you do the same thing on an airplane, and everyone joins in!"
the compiler doesn''t know SOCK

maybe it''s typedefed inside an #if which isn''t satisfied...
probably errors in other header files. for example:
// in some.cpp#include "someheader.h"    // error here#include "wsutil.h"        // this get infected 


it''s the .cpp files that get compiled, thus errors are there, not in headers. I believe if you make one .cpp file, and just #include "wsutil.h" and nothing else in it, it won''t give you any errors. check your other files (sadly).

My compiler generates one error message: "does not compile."
are you sure?

try this just in case:

#ifndef SOCK
#define SOCK int
#endif
Advertisement
if you''re using vc++ 6.0, winsock.h has SOCKET as the typedef.

This topic is closed to new replies.

Advertisement