Quantcast
Viewing all articles
Browse latest Browse all 22011

Compiler change msvc 2019 vs. 2017 and gcc (mingw32) and error C2039

This is a request for feedback from anyone who would like to respond. Otherwise, since I already have a fix, this request can be closed very fast. My question:

Why does MSVC flag this as an error, while MSVC 2017 and gcc (mingw32) do not flag it?

This statement

using outputFunctionType = std::function<void(std::string const& identifier,
                                              std::string const& message)>;

leads to

error C2039: 'string': is not a member of 'std'

The source already contains

#include <functional>

which defines class function. Adding

#include <string>

solves the problem, as recommended in error C2039: 'string' : is not a member of 'std', header file problem


Viewing all articles
Browse latest Browse all 22011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>