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

C++ version problem? #248

Open
Tsbuild74 opened this issue May 14, 2024 · 1 comment
Open

C++ version problem? #248

Tsbuild74 opened this issue May 14, 2024 · 1 comment

Comments

@Tsbuild74
Copy link

I have no idea how to fix this. I have checked the Issues and tried to solve it like #241 but still had the error like c++ version things. Here's the information about the error:

Compiling absl/log/internal/conditions.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 32 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/com_google_absl/absl/base/config.h:92:0,
from external/com_google_absl/absl/base/attributes.h:37,
from external/com_google_absl/absl/log/internal/conditions.h:36,
from external/com_google_absl/absl/log/internal/conditions.cc:15:
external/com_google_absl/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
#error "C++ versions less than C++14 are not supported."
^~~~~
Target //:deepmind_lab.so failed to build
Use --verbose_failures to see the command lines of failed build steps.

So how can i solve this problem?

@tkoeppe
Copy link
Collaborator

tkoeppe commented Jul 24, 2024

What's your Bazel version? Can you make sure you're using a recent one? And also a recent compiler, or in any case make sure you pass -std=c++14 (or higher) as a compiler flag. Newer compilers will default to C++14 or higher, but older compilers might also support it, but need an explicit switch.

You can also tell Bazel to use our https://github.com/google-deepmind/lab/blob/master/.precommit.bazelrc, say via:

bazel --bazelrc=.precommit.bazelrc build [etc etc]

As you can see, we're setting -std=c++17 globally in the bazelrc file.

Or build with --cxxopt=-std=c++14.

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