Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOCKET no longer defined since winsock2.h removed from zmq.h #382

Closed
Dysl3xik opened this issue Feb 3, 2020 · 5 comments
Closed

SOCKET no longer defined since winsock2.h removed from zmq.h #382

Dysl3xik opened this issue Feb 3, 2020 · 5 comments

Comments

@Dysl3xik
Copy link

Dysl3xik commented Feb 3, 2020

If you try to build this library with a newer release of ZeroMQ, on a windows box, you get errors because SOCKET can't be resolved in compatability.h.

This was introduced in this merge I believe: zeromq/libzmq#3681

I will submit a PR that introduces the same fix into this code base as was proposed in that one.

@sigiesec sigiesec changed the title SOCKET long longer defined since winsock2.h removed from zmq.h SOCKET no longer defined since winsock2.h removed from zmq.h Feb 3, 2020
@sigiesec
Copy link
Member

sigiesec commented Feb 3, 2020

Sounds good, thank you!

@Dysl3xik
Copy link
Author

Dysl3xik commented Feb 3, 2020

Oops deeply sorry, I meant to post this to https://github.com/zeromq/zmqpp !

@Dysl3xik Dysl3xik closed this as completed Feb 3, 2020
@daravi
Copy link

daravi commented May 23, 2020

Hi. I also see this issue (at least with Visual Studio 17). I have to add winsock2.h include to zmq.hpp before I could compile my consuming project. I am confused why this issue was closed. Is a PR welcomed or is there a more preferable solution?

#ifdef _WIN32
#include <winsock2.h>
#endif

@jaewooklee93
Copy link

I've encountered same error

@daravi 's solution nicely works.

Also, I'd like to point out #include statements should be below #define NOMINMAX

#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <WinSock2.h>
#endif

Maybe I should open a new issue

@Dysl3xik
Copy link
Author

Guys I closed it because I was using the other ZeroMQ CPP project and intended to post there. However this project is probably afflicted the same way.

The issue + PR I issued for that library is here zeromq/zmqpp#233 but the fix there was a tad different because they had an aliased socket type.

If you are experiencing the issue on this library you should re-open this issue and do a PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants