Ws2_32.lib is not on my system

Aug 2, 2018 at 6:55am
Hey guys,

Both my work computer and home computer just doesn't have the Ws2_32.lib library. I've searched all the folders and ... nothing. I do have Ws2_32.dll, but copying it into my working folder doesn't do the trick. My system still says "cannot find -lWs2_32.lib"

Why did it put a minus el in front of Ws2_32.lib, does that mean something?

Please help, I'm burning out with how many hours I've put in.

Thank you in advance.
Aug 2, 2018 at 3:14pm
What compiler / IDE do you use?
If you don't use Visual Studio you might need to download the Windows SDK separately.
Aug 6, 2018 at 3:19am
Code Blocks is my IDE
MingW is my compiler

... I'll look in to downloading Visual Studios
Last edited on Aug 22, 2018 at 8:20am
Aug 6, 2018 at 1:46pm
closed account (E0p9LyTq)
Code Blocks is my IDE
MingW is my compiler

Library files for MinGW are not .lib files, they are lib[library_name].a as a substitute.

I looked in my Code::Blocks directory, navigated to the MinGW lib directory, and I found a libws2_32.a.

It would not hurt to have several IDEs/compilers installed, VS and C:B would be a good choice.
Aug 6, 2018 at 2:02pm
closed account (E0p9LyTq)
... I'll looking to downloading Visual Studios

If you do decide to get VS you should know a "typical" install doesn't add C++ to the install queue. You have to manually select it.
Aug 22, 2018 at 8:21am
This is all good information, thank you!
Aug 22, 2018 at 1:50pm
This is a linker error and not a run-time error, correct?

Assuming, as FurryGuy noted, that you have libws2_32.a in your MinGW lib directory, you need to add that library to be looked for by CodeBlocks. Go to Project build options --> Linker settings --> and add ws2_32.

Try playing around with other command-line options as well, noted in
https://stackoverflow.com/questions/35003396/mingw-w64-searches-for-libws2-32-dll-instead-of-ws2-32-dll
Last edited on Aug 22, 2018 at 1:50pm
Topic archived. No new replies allowed.