?
=?iso-8859-1?q?|-|e|=5F|=5F_B0=DD?=
hi all!
I got a problem. I declared a SOCKET var in my C program but when i
compiled the program it displayed like
*--------------------------------------------------------------*
*'SOCKET': illegal use of this type as an expression *
* C:\..\..\..\include\winsock2.h: see declaration of 'SOCKET' *
*--------------------------------------------------------------*
What i wrote in my program is like this..:
//-------------------------------------------------------------
//I am still trying to create a Socket and use it
SOCKET m_socket; // <- *this is where i got mad!
m_socket=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(m_socket==INVALID_SOCKET){
printf("Error at socket(): %ld\n socket yadre!!",
WSAGetLastError());
WSACleanup();
return 0;
}else{
printf("socket() is ok [sijinaba yare]!\n");
}
//-------------------------------------------------------------
How i compiled is like this...:
[compiler info: C/C++ compiler version 14.00.50727.42 for 80x86]
-
-cl /Tc sok_unf.c ws2_32.Lib
More info:
I m using Windows XP SP2.
Please help me out. i'll be very thankful to you!!
I got a problem. I declared a SOCKET var in my C program but when i
compiled the program it displayed like
*--------------------------------------------------------------*
*'SOCKET': illegal use of this type as an expression *
* C:\..\..\..\include\winsock2.h: see declaration of 'SOCKET' *
*--------------------------------------------------------------*
What i wrote in my program is like this..:
//-------------------------------------------------------------
//I am still trying to create a Socket and use it
SOCKET m_socket; // <- *this is where i got mad!
m_socket=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(m_socket==INVALID_SOCKET){
printf("Error at socket(): %ld\n socket yadre!!",
WSAGetLastError());
WSACleanup();
return 0;
}else{
printf("socket() is ok [sijinaba yare]!\n");
}
//-------------------------------------------------------------
How i compiled is like this...:
[compiler info: C/C++ compiler version 14.00.50727.42 for 80x86]
-
-cl /Tc sok_unf.c ws2_32.Lib
More info:
I m using Windows XP SP2.
Please help me out. i'll be very thankful to you!!