Winsock2.h and Platform SDK

Reply

Join Date: Jun 2005
Posts: 33
Reputation: shre86 is an unknown quantity at this point 
Solved Threads: 1
shre86 shre86 is offline Offline
Light Poster

Winsock2.h and Platform SDK

 
0
  #1
Jun 16th, 2005
I am trying to develop a basic communicating link using windows sockets in visual studio.net2003... but it is showing an lnk2001 error.. is it necessary that have to get the platform SDK and install it before i can use winsock2.h????
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: Winsock2.h and Platform SDK

 
0
  #2
Jun 16th, 2005
You probably just need to incude the appropriate .lib in your studio project. Without the link error, I don't know which .lib...)
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 33
Reputation: shre86 is an unknown quantity at this point 
Solved Threads: 1
shre86 shre86 is offline Offline
Light Poster

Re: Winsock2.h and Platform SDK

 
0
  #3
Jun 17th, 2005
Originally Posted by winbatch
You probably just need to incude the appropriate .lib in your studio project. Without the link error, I don't know which .lib...)
this is the link error it is showing:

Linking...
a.obj : error LNK2001: unresolved external symbol "int __stdcall connect(unsigned int,struct sockaddr const *,int)" (?connect@@$$J212YGHIPBUsockaddr@@H@Z)
a.obj : error LNK2001: unresolved external symbol "unsigned short __stdcall htons(unsigned short)" (?htons@@$$J14YGGG@Z)
a.obj : error LNK2001: unresolved external symbol "unsigned long __stdcall inet_addr(char const *)" (?inet_addr@@$$J14YGKPBD@Z)
a.obj : error LNK2001: unresolved external symbol "int __stdcall WSACleanup(void)" (?WSACleanup@@$$J10YGHXZ)
a.obj : error LNK2001: unresolved external symbol "int __stdcall WSAGetLastError(void)" (?WSAGetLastError@@$$J10YGHXZ)
a.obj : error LNK2001: unresolved external symbol "unsigned int __stdcall socket(int,int,int)" (?socket@@$$J212YGIHHH@Z)
a.obj : error LNK2001: unresolved external symbol "int __stdcall WSAStartup(unsigned short,struct WSAData *)" (?WSAStartup@@$$J18YGHGPAUWSAData@@@Z)
H:\Project\work\aa\Debug\aa.exe : fatal error LNK1120: 7 unresolved externals

Build log was saved at "file://h:\Project\work\aa\aa\Debug\BuildLog.htm"
aa - 8 error(s), 0 warning(s)


pls help....
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: Winsock2.h and Platform SDK

 
0
  #4
Jun 17th, 2005
You have to link with:

Ws2_32.lib.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 33
Reputation: shre86 is an unknown quantity at this point 
Solved Threads: 1
shre86 shre86 is offline Offline
Light Poster

Re: Winsock2.h and Platform SDK

 
0
  #5
Jun 17th, 2005
Originally Posted by winbatch
You have to link with:

Ws2_32.lib.

could u pls tell me how i do that.. i am a beginner so have lots to learn
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC