-
Notifications
You must be signed in to change notification settings - Fork 494
[BUILD] Visual Studio GMOCK_LIB issues and explicit c++17 #3158
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
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch.
This needs more investigations, to understand the root cause.
|
||
# Force C++17 | ||
if(MSVC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can not have that, this will break everybody.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to find an alternative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcalff The only other way I can get it to compile with vs2022 is to add "-DWITH_STL=CXX14"
Other wise i get
warning STL4038: The contents of <string_view> are available only with C++17 or later.
C:\Users\Administrator\Git\opentelemetry-cpp\api\include\opentelemetry/std/string_view.h(18): error C2039: 'string_view': is not a member of 'std'
This is during stl
build, nostd
works without this (of course).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use -DCMAKE_CXX_STANDARD=17
when running cmake command to use C++17 in your environment.
This problem should already be fixed by #3203 , could you please try the main branch? |
As indicated earlier, the issues related to GMOCK_LIB have been resolved already. Now closing this PR, since it is not needed. If somehow the latest code in opentelemetry-cpp still does not work, please file an issue with the current findings. |
Changes
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes