I am trying to get my hands on windows socket programming.
I know that you have to #include winsock2.h
and then link with ws2_32.lib
.
Problem is I do not have ws2_32.lib
in my visual studio 2010 ultimate version.
What should I do to get it up and running?
Secondly, I stumble with integrating new API's in VS 2010 a lot. I keep on forgetting what to include and what to link and which files are included and which are linked.It would be great if you could point out a tutorial which gives a general procedure in VS 2010 to deal with include and lib files while integrating a new API.
Most likely you do have this library but it must be added via Project->Poperties->Linker->Input->additional Dependencies. Type this there:
Ws2_32.lib
or programmatically:
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
#pragma comment(lib, "Ws2_32.lib")
int main() {
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With