I was just wondering if anyone knew whether Dev C++ supports Winsock programming. Can I link to wsock32.lib from Dev C++? I suppose that this actually has to do with Mingw
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-12-06
In MinGW the convention for library names is libXXX.a, so the correct library is libwsock32.a. Libraries in folders defined by -L<path> linker options can be linked with the option -lXXX (so -lwsock32 for example), the lib prefix and .a extension are assumed. c:\dev-cpp\lib (where libwsock32.a lives) is a default library path in the standard installation.
libws2_32.a (nemtioned by Osito) is the correct library for Windows Sockets version 2. This is a superset of wsock32 (Windows Sockets version 1) so you should probably use the newer library. You can use either.
It is as you suggest a MinGW issue, you can always look at www.mingw.org (and that is a good place to get the latest Win32 API files - although you can use WebUpdate also, but they may not be the 'latest'). You might also have looked in the Dev-C++ include and lib directories, the presence of the relevant header and library files is a big give-away to te answer to your question.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was just wondering if anyone knew whether Dev C++ supports Winsock programming. Can I link to wsock32.lib from Dev C++? I suppose that this actually has to do with Mingw
In MinGW the convention for library names is libXXX.a, so the correct library is libwsock32.a. Libraries in folders defined by -L<path> linker options can be linked with the option -lXXX (so -lwsock32 for example), the lib prefix and .a extension are assumed. c:\dev-cpp\lib (where libwsock32.a lives) is a default library path in the standard installation.
libws2_32.a (nemtioned by Osito) is the correct library for Windows Sockets version 2. This is a superset of wsock32 (Windows Sockets version 1) so you should probably use the newer library. You can use either.
It is as you suggest a MinGW issue, you can always look at www.mingw.org (and that is a good place to get the latest Win32 API files - although you can use WebUpdate also, but they may not be the 'latest'). You might also have looked in the Dev-C++ include and lib directories, the presence of the relevant header and library files is a big give-away to te answer to your question.
Clifford
I have done Winsock stuff with Dev. My linker line is -lws2_32 though, so that's not the same lib you're using.