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

C++17 and C++20 not Building with VS2019 #1121

Closed
ghost opened this issue Dec 8, 2021 Discussed in #1120 · 0 comments · Fixed by #1144
Closed

C++17 and C++20 not Building with VS2019 #1121

ghost opened this issue Dec 8, 2021 Discussed in #1120 · 0 comments · Fixed by #1144
Assignees
Labels
bug Something isn't working do-not-stale

Comments

@ghost
Copy link

ghost commented Dec 8, 2021

Discussed in #1120

Originally posted by ddave-440 December 7, 2021

I have a simple console app (VS2019) on Windows 10 that will build with C++14 but not with C++17 or C++20.

The app is:

#include <iostream>
#include "opentelemetry/exporters/jaeger/jaeger_exporter.h"
#include "opentelemetry/sdk/trace/simple_processor.h"
#include "opentelemetry/sdk/trace/tracer_provider.h"
#include "opentelemetry/trace/provider.h"

namespace trace = opentelemetry::trace;
namespace nostd = opentelemetry::nostd;
namespace trace_sdk = opentelemetry::sdk::trace;
namespace jaeger = opentelemetry::exporter::jaeger;

int main()
{
    std::cout << "Hello World!\n";
}

With C++17, I get errors such as:
opentelemetry\nostd\absl\meta\type_traits.h(620,1): error C4996: 'std::result_of<Op (const bool &)>': warning STL4014: std::result_of and std::result_of_t are deprecated in C++17. They are superseded by std::invoke_result and std::invoke_result_t. You can define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. 1> with 1> [ 1> Op=opentelemetry::v1::sdk::common::AttributeConverter & 1> ] 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\type_traits(1739,1): message : see declaration of 'std::result_of<_Callable(_Args...)>'

With C++20, I get:
\api\include\opentelemetry\nostd\absl\meta\type_traits.h(620,35): error C2039: 'result_of': is not a member of 'std' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include\functional(31): message : see declaration of 'std'

I am probably missing something but am wondering if this should build with C++17 or C++20 without changes?

@lalitb lalitb added bug Something isn't working do-not-stale labels Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working do-not-stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants