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 find the protoc header files #1980

Open
ImNoahDev opened this issue Oct 18, 2024 · 1 comment
Open

Cannot find the protoc header files #1980

ImNoahDev opened this issue Oct 18, 2024 · 1 comment

Comments

@ImNoahDev
Copy link

Hello,

I am trying to build OLA from source on macos (M2) but when running ./configure I run into this problem:

checking for protoc... /Users/user1/miniconda3/bin/protoc
checking protoc version... 25.3.0
checking for google/protobuf/compiler/command_line_interface.h... no
configure: error: Cannot find the protoc header files

I have tried various ways of installing protobuf but I cannot seem to fix it, can anyone help?

@jcelerier
Copy link

The problem is that the build system forces C++11 while nowadays every compiler defaults to C++17 at least - Xcode has been defaulting to C++20 for two years now, C++11 is older than C++98 was when C++11 was released :)

In particular, recent versions of protoc require abseil which requires at least C++14:

configure:26189: checking protoc version
configure:26216: result: 28.2.0
configure:26240: checking for google/protobuf/compiler/command_line_interface.h
configure:26240: g++ -c -g -O2 -std=gnu++11   conftest.cpp >&5
In file included from /usr/include/absl/base/config.h:92,
                 from /usr/include/absl/base/attributes.h:37,
                 from /usr/include/absl/container/btree_map.h:58,
                 from /usr/include/google/protobuf/compiler/command_line_interface.h:25,
                 from conftest.cpp:178:
/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~
In file included from /usr/include/absl/base/internal/raw_logging.h:27,
                 from /usr/include/absl/container/internal/btree.h:61,
                 from /usr/include/absl/container/btree_map.h:59:
/usr/include/absl/base/log_severity.h: In function 'constexpr const char* absl::lts_20240722::LogSeverityName(LogSeverity)':
--
configure:26245: error: Cannot find the protoc header files

I would suggest removing the forced -std=gnu++11 and let the compiler use their default (more recent) standard

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