Bazel build of example failed
My system:
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
> gcc --version
gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
Steps to reproduce Build an example (logs_simple) by running the command from the root directory of the repo
> bazel build examples/logs_simple:example_logs_simple
What is the expected behavior? It should build the example and generate the binary (example_logs_simple).
What is the actual behavior? The build fails as follows:
> bazel build examples/logs_simple:example_logs_simple
INFO: Analyzed target //examples/logs_simple:example_logs_simple (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/office/opentelemetry/opentelemetry-cpp/sdk/src/logs/BUILD:6:11: Compiling sdk/src/logs/readable_log_record.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 22 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from sdk/src/logs/readable_log_record.cc:5:
bazel-out/k8-fastbuild/bin/sdk/_virtual_includes/headers/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h:76:12: error: 'std::enable_if_t' has not been declared
76 | std::enable_if_t<opentelemetry::common::detail::is_key_value_iterable<ArgumentType>::value>
| ^~~~~~~~~~~
bazel-out/k8-fastbuild/bin/sdk/_virtual_includes/headers/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h:76:23: error: expected '>' before '<' token
76 | std::enable_if_t<opentelemetry::common::detail::is_key_value_iterable<ArgumentType>::value>
| ^
Target //examples/logs_simple:example_logs_simple failed to build
Use --verbose_failures to see the command lines of failed build steps.
Could you please try bazel build --host_cxxopt=-std=c++14 --cxxopt=-std=c++14 examples/logs_simple:example_logs_simple ?
@owent thanks. This hack worked.
Opentelemetry-cpp no longer supports C++11:
- #1830
- #2147
Opentelemetry-cpp no longer supports C++11:
@marcalff Thanks. Seems like it doesn't support C++12 either.
@shiponcs what OpenTelemetry SDK version is built here?
@ThomsonTan
tip of the current main branch.
This issue was marked as stale due to lack of activity.