[Mingw-users] The std::to_string problem is back

Back to archive index
Eli Zaretskii eliz****@gnu*****
Thu Apr 18 22:40:26 JST 2019


With GCC 8.2.0, the problem with using std::to_string is back, with a
vengeance.  The following toy program, posted by Keith almost 2 years
ago:

  #include <string>
  int main() { std::to_string(10); }

compiles cleanly with MinGW GCC 7.3.0, but fails with GCC 8.2.0:

  tts.cpp: In function 'int main()':
  tts.cpp:2:19: error: 'to_string' is not a member of 'std'
   int main() { std::to_string(10); }
		     ^~~~~~~~~~

This is with the same MinGW runtime 5.2.1, and it doesn't help to
explicitly specify -std=c++11 (as expected, since the default standard
should already support the above).

I compared both c++config.h and basic_string.h in the libstdc++
headers that come with GCC 7.3.0 and 8.2.0, and didn't see any
difference in the relevant places.  So what else could explain this
old-new problem?

P.S. The way I became aware of this is, of course, by trying to
compile a GDB pretest with GCC 8.2.0 and the latest mingwrt.



More information about the MinGW-Users mailing list
Back to archive index