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

Compilation failure on old system #356

Open
zephod77 opened this issue Nov 28, 2022 · 3 comments
Open

Compilation failure on old system #356

zephod77 opened this issue Nov 28, 2022 · 3 comments

Comments

@zephod77
Copy link

I'm trying to compile on an old Centos7 machine. All I've done is add the zmq = "0.10.0" dependency to my Cargo.toml file and rebuild and zmq-sys fails with this error:

[zmq-sys 0.12.0] cargo:warning=/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and li brary support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or - std=gnu++11 compiler options.

So my question is where do I add that c++ compiler option?

@zephod77 zephod77 changed the title Compilation failure old old system Compilation failure on old system Nov 28, 2022
@zephod77
Copy link
Author

Update: The files that are failing to compile is mailbox_safe.cpp and mailbox.cpp. If I manually add the -std=c++11 flag, then it will compile. I can see that autoconf tools are being used and that there are tests for "gnu11" to set the -std flag so they must be failing for some reason.

@zephod77
Copy link
Author

Found a solution. I had to create an environment variable CXXFLAGS and set it to -std=c++11.
I ended up creating a .cargo directory in my project's home and adding a file config.toml with the contents:

[env]
CXXFLAGS = "-std=c++11"

I don't know if this is considered a "good" solution but it works for me.

@hikaricai
Copy link

Same issue,thanks for the solution

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