Skip to content

Can't compile the open telemetry for C++14 #2369

Answered by marcalff
PeterStayPool asked this question in Q&A
Discussion options

You must be logged in to vote

Analysis as follows.

The error message seen at build time, by the compiler (not the linker), comes from:

#if __cplusplus >= 201703L
// std::result_of is deprecated (C++17) or removed (C++20)
template<typename> struct result_of;
template<typename F, typename... Args>
struct result_of<F(Args...)> : std::invoke_result<F, Args...> {};
#else
template<typename F> using result_of = std::result_of<F>;
#endif

__cplusplus >= 201703L is testing that the compiler supports C++17 language features

std::invoke_result is part of the C++17 STL, so in this case, in an environment with a C++17 compiler / C++ 14 STL, this fragment of code will fail.

A work around is to build in C++14 instead, not sure if th…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by PeterStayPool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants