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

[Bug]: C++ versions less than C++14 are not supported #1431

Closed
Chellapandi opened this issue Apr 18, 2023 · 2 comments
Closed

[Bug]: C++ versions less than C++14 are not supported #1431

Chellapandi opened this issue Apr 18, 2023 · 2 comments

Comments

@Chellapandi
Copy link

Describe the issue

I am getting the below issue:

In file included from external/com_google_absl/absl/crc/internal/cpu_detect.cc:15:
In file included from external/com_google_absl/absl/crc/internal/cpu_detect.h:18:
In file included from external/com_google_absl/absl/base/config.h:86:
external/com_google_absl/absl/base/policy_checks.h:79:2: error: "C++ versions less than C++14 are not supported."
#error "C++ versions less than C++14 are not supported."

Config:
Protobuf : 21.12
protoc : libprotoc 3.17.3
Bazel : 5.4.0
bazel depenedency:
http_archive(
name = "com_google_protobuf",
sha256 = "2118051b4fb3814d59d258533a4e35452934b1ddb41230261c9543384cbb4dfc",
strip_prefix = "protobuf-3.22.2",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.22.2.tar.gz"],
)
Language: Golang

Steps to reproduce the problem

When I run bazel build //..., I am getting above issue.

What version of Abseil are you using?

We are not explicitly using absl library. Protocol buffers uses this internally. Here I have raised an issue. They suggested me to raise a issue here.

What operating system and version are you using?

MacOS Monterey 12.6.3

What compiler and version are you using?

I used the below workaround in .bazelrc

build --cxxopt=-std=c++20
build --host_cxxopt=-std=c++20

What build system are you using?

Bazel and Version is 5.4.0.

Additional context

No response

@derekmauro
Copy link
Member

This is working as intended.

@derekmauro derekmauro closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
stanhu added a commit to stanhu/re2 that referenced this issue Jul 3, 2023
Whether intentional or not,
https://code-review.googlesource.com/c/re2/+/61250 made re2 depend
directly on abseil. The latest version of abseil now requires C++14
(abseil/abseil-cpp#1127). However, it seems
that supplying `-std=c++14` isn't enough
(abseil/abseil-cpp#1431). `-std=c++17` needs
to be used at least.

This commit fixes the compilation by trying C++20 and C++17 if the
initial compilation fails. This fixes build issues on macOS.
stanhu added a commit to stanhu/re2 that referenced this issue Jul 3, 2023
https://code-review.googlesource.com/c/re2/+/61250 made re2 depend
directly on abseil. The latest version of abseil now requires C++14
(abseil/abseil-cpp#1127). However, it seems
that supplying `-std=c++14` isn't enough
(abseil/abseil-cpp#1431). `-std=c++17` needs
to be used at least.

This commit fixes the compilation by trying C++20 and C++17 if the
initial compilation fails. This fixes build issues on macOS.
mudge pushed a commit to mudge/re2 that referenced this issue Jul 4, 2023
https://code-review.googlesource.com/c/re2/+/61250 made re2 depend
directly on abseil. The latest version of abseil now requires C++14
(abseil/abseil-cpp#1127). However, it seems
that supplying `-std=c++14` isn't enough
(abseil/abseil-cpp#1431). `-std=c++17` needs
to be used at least.

This commit fixes the compilation by trying C++20 and C++17 if the
initial compilation fails. This fixes build issues on macOS.
@siennathesane
Copy link

Can confirm this fixed it for me, too.

$ bazelisk --version
bazel 6.2.1

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

3 participants