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

Not all compiler support all C++20's components when using -std=c++20 #3200

Closed
owent opened this issue Dec 13, 2024 · 2 comments · Fixed by #3203
Closed

Not all compiler support all C++20's components when using -std=c++20 #3200

owent opened this issue Dec 13, 2024 · 2 comments · Fixed by #3203
Assignees
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@owent
Copy link
Member

owent commented Dec 13, 2024

Describe your environment

OS: Linux
Compiler: GCC 11

Steps to reproduce
Compiling otel-cpp with -std=c++20

What is the expected behavior?
Building success.

What is the actual behavior?

/home/runner/work/cmake-toolset/cmake-toolset/test/third_party/packages/opentelemetry-cpp-v1.18.0/exporters/elasticsearch/src/es_log_recordable.cc:181:36: error: ‘format’ is not a member of ‘std’
  181 |   const std::string dateStr = std::format("{:%FT%T%Ez}", timePoint);
      |                                    ^~~~~~
gmake[2]: *** [exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/build.make:93: exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/src/es_log_recordable.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1593: exporters/elasticsearch/CMakeFiles/opentelemetry_exporter_elasticsearch_logs.dir/all] Error 2

Additional context
https://github.com/owent/cmake-toolset/actions/runs/12311600885/job/34362063562

There may be other errors

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
[cmake] Please set them or make sure they are set and tested correctly in the CMake files:
[cmake] GMOCK_LIB
[cmake]     linked by target "url_parser_test" in directory D:/workspace/git/github/opentelemetry/opentelemetry-cpp/ext/test/http
[cmake]     linked by target "curl_http_test" in directory D:/workspace/git/github/opentelemetry/opentelemetry-cpp/ext/test/http
[cmake] 
[cmake] CMake Generate step failed.  Build files cannot be regenerated correctly.
@owent owent added the bug Something isn't working label Dec 13, 2024
@owent owent self-assigned this Dec 13, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 13, 2024
@lalitb
Copy link
Member

lalitb commented Dec 13, 2024

I'm wondering if features from C++17 and later should be conditionally allowed in the code using preprocessor directives (as in this case), as addressing errors related to them could be challenging.

@owent
Copy link
Member Author

owent commented Dec 13, 2024

I'm wondering if features from C++17 and later should be conditionally allowed in the code using preprocessor directives (as in this case), as addressing errors related to them could be challenging.

The library feature-test macros are only be defined after the headers are included. But we can not include it when it's not exists. The document says the macros will also be defined when <version> is inclued.
I will test it.

@marcalff marcalff added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants