• Advertisement
Sign in to follow this  

help with winsock2.h

This topic is 4244 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

Hey all, I learned early on in using winsock2.h that I must include it before windows.h. However, I was just reworking my current project and I started getting the 57 redefinition errors that you would expect if I were including the libraries in the wrong order. Fine. But, I'M NOT INCLUDING WINDOWS.H ANYWHERE (shouting caps directed at vc++ :) Are there any other libraries that would cause the same conflict, or something else that I should be looking for?

Share this post


Link to post
Share on other sites
Advertisement
I got that problem, so I just included winsock first, fixed the problem.

OpenGL libraries seem to do it though.

Share this post


Link to post
Share on other sites
I fixed it by moving the order of the includes around. At first I started logically, and then frustration set in and I just started moving things around randomly until the right combination worked. I know that wasn't the best method, but time is starting to become a factor. The last move involved putting <vector> before <winsock2.h>.

I really don't know why those two would interfere with each other, but I'm not really versed much on precompiler directives.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement