I can't use sock2.h & winsock2.h and some another *.h files,
My frient told me that it's because i need to download "LIB" for C\C++ (for windows), So i start search but unsuccesfull, So anyone can send me a URL or upload them to somewhere?
I can't use sock2.h & winsock2.h and some another *.h files,
My frient told me that it's because i need to download "LIB" for C\C++ (for windows), So i start search but unsuccesfull, So anyone can send me a URL or upload them to somewhere?
The libraries usually come with your compiler, you do not need to download them. The current MS library is called ws2_32.lib, using header winsock2.h. You need to tell your linker to use it. You don't say what compiler/IDE you are using however.
As an aside, downloading a library for a header you have is inevitably a bad idea, there is no way you can be sure the library and the header match etc. etc. If you must, download the library AND the header at the same time from the same place with the same version numbers etc.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
"You need to tell your linker to use it."
How can i do that?
btw - i use Visual C++
Click Project->Settings then the Link tab, put your cursor in the edit box labelled "Object/Library modules:" then press the "End" key to get to the end of the existing list and type the library name, (ws2_32.lib), there.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Compiling...
Sock1.cpp
c:\program files\microsoft visual studio\myprojects\sock1\sock1.cpp(3) : fatal error C1083: Cannot open include file: 'winsock32.h': No such file or directory
Error executing cl.exe.
Sock1.exe - 1 error(s), 0 warning(s)
Steel, i having a problem... :\
Here my include files:
#include <winsock.h>
#include <winsock32.h>
#include <windows.h>
>>> current MS library is called ws2_32.lib, using header winsock2.h
... i.e. not 32!
You shouldn't need winsock.h, just winsock2.h.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
It's working, i was need to #include <stdio.h>, 10x for the help!