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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ws2_32.lib vs. winsock.h 1

Status
Not open for further replies.

GabeC

Programmer
Apr 17, 2001
245
US
What is the difference between using these two lines of code?

#include <Ws2_32.lib>

and

#include <winsock.h>


Which should I use in my application?


Thanks,

Gabe
 
Well, you can't just &quot;include&quot; a lib file like that!
(Just open one in a text editor and see for yourself!)
You have to &quot;link&quot; to it by instructing your compiler to do so. What compiler are you using? For Bloodshed, just go to project->project_options and in the &quot;additional linker...&quot; box type: &quot;-lwsock32&quot;. And of course include winsock.h in your project as well...
 
Thank you Sebastiani. That did the trick.

Thanks,

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top