Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

emileej

Winsock2

This topic is 5732 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do i link to the winsock2 lib from my DevC++ project? I can''t find the .lib file in the lib dir, and if i try placing the winsock2 lib file from MSVC++ in the DevC++ lib dir, it''s like the file isn''t there... Please help! ------------- E-)mil I am me - no doubt about that.

Share this post


Link to post
Share on other sites
Advertisement
Aww - i was looking for ws2_32.lib - not libws2_32.a
Anyhow - what you''re sayin make sence - except for the fact that is doesn''t work (no matter how hard i try)
I have tried to add the following to the "Project options" - "Linker options / Optional Libs or Object files":

-l libws2_32
-llibws2_32
-l libws2_32.a
libws2_32
libws2_32.a

And further more i tried all of the above with the std. lib folder added in "Files / Directives" - "Library Directories" in the project options...

No matter what i tried of the above, i kept getting this "No such file or directory" linker error I don''t get it...

-------------
E-)mil
I am me - no doubt about that.

Share this post


Link to post
Share on other sites
Well I don't know what to tell you on that one, here's what I think could be the prob

1 make sure the file libw2_32.a is in the lib directory of dev-cpp.

2 Make sure the linker is pointing to the correct directory.

3 don't use .a, type in exactly -llibw2_32 (notice the two Ls)

4 make sure the linker isn't saying it's missing another library

http://roninmagus.hopto.org
acronymfinder.com - Find any acronym you need!

[edited by - Ronin Magus on December 6, 2002 10:43:55 AM]

Share this post


Link to post
Share on other sites
>>Ronin
Now you''re comfusin me - it is "-l libws2_32" and the file is "libws2_32.a" right? Thats what i type and the file which i have.
It doesn''t work

>>Stan100
Winsock is the windows sockets api - making accessing network protocols as tcp and udp a piece of cake (when the files will link - that is ).

-------------
E-)mil
I am me - no doubt about that.

Share this post


Link to post
Share on other sites
libw2_32.a is the filename. But it will not work if you type that into the linker textbox, because it automatically adds the .a to the end and you will get libw2_32.a.a which is not the right filename.

so, it should be:

-l libw2_32

-l (lowercase L) means include the following library.

libw2_32 is the name of the library.

[edited by - Ronin Magus on December 6, 2002 3:39:59 PM]

Share this post


Link to post
Share on other sites
Oh! I had typed an uppercase ''i'' as in ''include''. Anyways it still doesn''t work, as i only have a library named "libws2_32.a" not "libw2_32.a". The wired thing is, that even though i type the name of the file i have "-l libws2_32" - it still gives a file doesn''t exist - linker error...

-------------
E-)mil
I am me - no doubt about that.

Share this post


Link to post
Share on other sites
Thanks slave! Youre a genius - you saved me from goin nuts over this =D Thanks a lot

-------------
E-)mil
I am me - no doubt about that.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!