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

Cannot build with stable-x86_64-pc-windows-gnu #368

Open
BorisGerretzen opened this issue Feb 24, 2023 · 3 comments
Open

Cannot build with stable-x86_64-pc-windows-gnu #368

BorisGerretzen opened this issue Feb 24, 2023 · 3 comments

Comments

@BorisGerretzen
Copy link

When I am using stable-x86_64-pc-windows-msvc everything works fine, but I need the gnu one for the debugger to work in CLion. I switched to the gnu one by using rustup default stable-x86_64-pc-windows-gnu, then when I build I get errors about missing header files. When I look at the source code of one of the header files that is causing this issue (err.hpp) I see:

#ifndef ZMQ_HAVE_WINDOWS
#include <netdb.h>
#endif

So I guess ZMQ_HAVE_WINDOWS needs to be defined? I have no clue on how to do this, I have tried putting it in config.toml, adding it to the run configuration in CLion, and adding it as an environment variable, all to no avail.

warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\blob.hpp:34:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\channel.hpp:33,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\channel.cpp:32:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\precompiled.hpp:60:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\curve_server.cpp:30:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\zmq_draft.h:117:9: error: 'SOCKET' does not name a type
warning:  typedef SOCKET zmq_fd_t;
warning:          ^
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\msg.hpp:37:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\curve_mechanism_base.cpp:33:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\msg.hpp:37:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\decoder_allocators.hpp:37,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\decoder_allocators.cpp:31:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\clock.cpp:34:0:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\epoll.cpp:32:0:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\epoll.hpp:42:23: fatal error: sys/epoll.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\precompiled.hpp:60:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\endpoint.cpp:30:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\zmq_draft.h:117:9: error: 'SOCKET' does not name a type
warning:  typedef SOCKET zmq_fd_t;
warning:          ^
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\blob.hpp:34:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dgram.hpp:33,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dgram.cpp:32:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\precompiled.hpp:60:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\curve_client.cpp:30:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\zmq_draft.h:117:9: error: 'SOCKET' does not name a type
warning:  typedef SOCKET zmq_fd_t;
warning:          ^
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\poller.hpp:46:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\devpoll.hpp:34,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\devpoll.cpp:31:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\epoll.hpp:42:23: fatal error: sys/epoll.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\options.hpp:40:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\own.hpp:36,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\socket_base.hpp:37,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dealer.hpp:33,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dealer.cpp:32:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\tcp_address.hpp:34:24: fatal error: sys/socket.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.cpp:31:0:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\options.hpp:40:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\own.hpp:36,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\socket_base.hpp:37,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dish.hpp:35,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dish.cpp:34:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\tcp_address.hpp:34:24: fatal error: sys/socket.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\options.hpp:40:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\own.hpp:36,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\socket_base.hpp:37,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\client.hpp:33,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\client.cpp:32:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\tcp_address.hpp:34:24: fatal error: sys/socket.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\blob.hpp:34:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\pipe.hpp:38,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\dist.cpp:32:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\address.cpp:32:0:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\address.hpp:38:24: fatal error: sys/socket.h: No such file or directory
warning: compilation terminated.
warning: In file included from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\yqueue.hpp:36:0,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\ypipe.hpp:34,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\mailbox.hpp:39,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\ctx.hpp:38,
warning:                  from C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\ctx.cpp:42:
warning: C:\Users\Boris\.cargo\registry\src\github.com-1ecc6299db9ec823\zeromq-src-0.2.4+4.3.4\vendor\src\err.hpp:44:19: fatal error: netdb.h: No such file or directory
warning: compilation terminated.
error: failed to run custom build command for `zmq-sys v0.12.0`
@quixoticaxis
Copy link

Are there any workarounds? I happen to encounter the same problem.

@BorisGerretzen
Copy link
Author

Nope, I couldn't figure it out and rewrote my application in C#.

@quixoticaxis
Copy link

quixoticaxis commented Sep 7, 2024

Nope, I couldn't figure it out and rewrote my application in C#.

Heh, thank you, and I came to check whether I can write Rust instead of using NetMQ.

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

2 participants