. Advertisement .
..3..
. Advertisement .
..4..
Here is the program I run:
#include <string>
int main()
{
std::to_string(0);
return 0;
}
After I run, it returns an error:
PS C:\Users\Anurag\SkyDrive\College\Programs> g++ -std=c++0x ttd.cpp
ttd.cpp: In function 'int main()':
ttd.cpp:11:2: error: 'to_string' is not a member of 'std'
Does anyone have any suggestions for the problem below: to_string is not a member of std in the cpp- How to correct it?
The cause:
You have got this error because
std::to_string
is not an exact patch of MinGW, it doesn’t work on MinGW. It can destroy the current programs by using the [v]swprintf’s Windows versions because it can use the quality signatures to replace them. Therefore, it will be able to cause the problems. Solution:You can make
std::to_string
work in harmony with MinGW by getting a patch. The MinGW-w64 project’s MinGW-w64 distros that use GCC 4.8.0 or later can solve this problem. Despite its name, the project offers both 32-bit and 64-bit toolchains. This problem is also fixed by the Nuwen MinGW distro distribution.#include <sstream>
must be included