Thread View: demon.ip.winsock
1 messages
1 total messages
Started by vikram
Fri, 21 Jan 2000 00:00
unable to run socket program
Author: vikram
Date: Fri, 21 Jan 2000 00:00
Date: Fri, 21 Jan 2000 00:00
68 lines
2324 bytes
2324 bytes
when i compile and link the socket() and WSAStartup etc.. program in
the VC++ environment ,
It give me linking error as followed by the program code .
Kindly help me out ...
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<winsock.h>
#include<windows.h>
void WinSockInit(void);
int main()
{ SOCKET s;
=3D20
WinSockInit();
s =socket( AF_INET , SOCK_STREAM , 0);
if( s == INVALID_SOCKET)
{ printf("\n error in the socket creation ");
_getch();
return 0;
}
printf("\n the socket was created successfully ");
_getch();
closesocket(s);
WSACleanup();
return 1;
}
void WinSockInit(void)
{ int error1;
WORD wVersionReg;
WSADATA data;
wVersionReg = MAKEWORD(1,1);
error1= WSAStartup(wVersionReg, &data);
if(error1 != 0)
exit(1);
}
************************************************************
--------------------Configuration: sockets - Win32 =3D
Debug--------------------
Compiling...
Soc1.cpp
Linking...
Soc1.obj : error LNK2001: unresolved external symbol _WSACleanup@0
Soc1.obj : error LNK2001: unresolved external symbol _closesocket@4
Soc1.obj : error LNK2001: unresolved external symbol _socket@12
Soc1.obj : error LNK2001: unresolved external symbol _WSAStartup@8
Debug/sockets.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
sockets.exe - 5 error(s), 0 warning(s)
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads