Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking errors with winsock.h

Status
Not open for further replies.

durango1

Programmer
Nov 27, 2000
2
US
Do any of you have experience using the WinSock API? I am getting a linker error and cannot figure out what is wrong. I have checked the file locations out and made sure I have the correct directories specified for the linker.

Any help will be appreciated, thanks.

Doug Schoettle
Memphis, Tn

Here is some of the error output:
Linking...
error LNK2001: unresolved external symbol _WSACleanup@0
error LNK2001: unresolved external symbol _WSAStartup@8
fatal error LNK1120: 2 unresolved externals

 
Doug,

That is a Winsock 2 call.

Requirements
Version: Requires Windows Sockets 1.1 or later.
Header: Declared in Winsock2.h.
Library: Use Ws2_32.lib.

Hope this helps
-pete
 

Using Windows 95 or earlier. Do the following in your VC project:

Go to Projects, Settings, Link, Object/library modules, add "wsock32.lib".

Bother C
 
Thanks for the input! After I initially posted my problem, I did try placing the library in the link list itself and that worked. I am still a little confused as to why it did not want to link before when I did have the directory specified in the list if library directories.

But, it is working now. Thanks for the help!
Doug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top