J
Jay
I am getting following error when trying to compile a sample program:
C:\DOCUME~1\user1\LOCALS~1\Temp\cckJbaaa.o(.text+0x38):test27.cpp:
undefined reference to `WSAStartup@8'
C:\DOCUME~1\user1\LOCALS~1\Temp\cckJbaaa.o(.text+0x71):test27.cpp:
undefined reference to `WSACleanup@0'
Here is my code:
// c program
#include <stdio.h>
#include <io.h>
#include <winsock.h>
int main()
{
WORD wVersionRequested = MAKEWORD(1,1);
WSADATA wsaData;
int nRet;
// Initialize WinSock.dll
nRet = WSAStartup(wVersionRequested, &wsaData);
if (nRet)
{
fprintf(stderr,"\nWSAStartup(): %d\n", nRet);
WSACleanup();
return 1;
}
return 0;
}
// END
How can I fix it?
Thanks in advance for any help.
C:\DOCUME~1\user1\LOCALS~1\Temp\cckJbaaa.o(.text+0x38):test27.cpp:
undefined reference to `WSAStartup@8'
C:\DOCUME~1\user1\LOCALS~1\Temp\cckJbaaa.o(.text+0x71):test27.cpp:
undefined reference to `WSACleanup@0'
Here is my code:
// c program
#include <stdio.h>
#include <io.h>
#include <winsock.h>
int main()
{
WORD wVersionRequested = MAKEWORD(1,1);
WSADATA wsaData;
int nRet;
// Initialize WinSock.dll
nRet = WSAStartup(wVersionRequested, &wsaData);
if (nRet)
{
fprintf(stderr,"\nWSAStartup(): %d\n", nRet);
WSACleanup();
return 1;
}
return 0;
}
// END
How can I fix it?
Thanks in advance for any help.