944,124 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 15288
  • C RSS
Jun 16th, 2005
0

Winsock2.h and Platform SDK

Expand Post »
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????
Similar Threads
Reputation Points: 10
Solved Threads: 1
Light Poster
shre86 is offline Offline
33 posts
since Jun 2005
Jun 16th, 2005
0

Re: Winsock2.h and Platform SDK

You probably just need to incude the appropriate .lib in your studio project. Without the link error, I don't know which .lib...)
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Jun 17th, 2005
0

Re: Winsock2.h and Platform SDK

Quote 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....
Reputation Points: 10
Solved Threads: 1
Light Poster
shre86 is offline Offline
33 posts
since Jun 2005
Jun 17th, 2005
0

Re: Winsock2.h and Platform SDK

You have to link with:

Ws2_32.lib.
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Jun 17th, 2005
0

Re: Winsock2.h and Platform SDK

Quote 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
Reputation Points: 10
Solved Threads: 1
Light Poster
shre86 is offline Offline
33 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Winsock LSP
Next Thread in C Forum Timeline: I-Q demod algorithm?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC