By the way, it was classy and cool for you to take the time to document your answer.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-01-06
All actually you need to do is add the linker option:
-lws2_32
This will look for the file libws2_32.a in the default library paths (the -L options).
I am not sure where you found ws2_32.lib or wsock.lib, but the naming convention for GNU libraries (or archives) would have them called libwsock.a and libws2_32.a - which is indeed the case with those supplied with Dev-C++ - so what are you using?
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My friend is trying to get the following code to work in Dev-C++, but it returns some form of 'link' error.
What files are required (and where do I place them) to get the following header working.
include <winsock2.h>
Thanks.
Fixed.
For future reference, this is how we did it:
:)
Getting the "header working" is a little off in concept. Take a moment and check out this link
http://sourceforge.net/forum/forum.php?thread_id=1036465&forum_id=48211
(Note you will probably have to click the Re: link on this post to get my link to work correctly - SourceForge is a little messed up now)
It will help you with headers and libraries.
Now, I suspect you are going to want to link the library known as ws2_32
Wayne
Actually, don't get in the habit of expecting libraries called something.lib to work with MinGW/GCC - libraries for GCC will generally have names like
libsomething.a
Wayne
By the way, it was classy and cool for you to take the time to document your answer.
Wayne
All actually you need to do is add the linker option:
-lws2_32
This will look for the file libws2_32.a in the default library paths (the -L options).
I am not sure where you found ws2_32.lib or wsock.lib, but the naming convention for GNU libraries (or archives) would have them called libwsock.a and libws2_32.a - which is indeed the case with those supplied with Dev-C++ - so what are you using?
Clifford
considering that extensions are hiding by default i imagine he saw libws2_32 and just assumed it had a lib extension.