Home > Article > Backend Development > Why is \"stoi\" not a member of \'std\' when compiling with MinGW 4.6.1?
std::stoi Issue in MinGW 4.6.1
The error "error: 'stoi' is not a member of 'std'" while compiling with MinGW 4.6.1 stems from a non-standard declaration of vswprintf on Windows.
Explanation:
The GNU Standard Library defines the macro _GLIBCXX_HAVE_BROKEN_VSWPRINTF on this platform. This macro disables certain conversion functions, including std::stoi.
Workaround:
To work around this issue, consider modifying the header files distributed with MinGW:
Consequences:
This workaround disables std::to_wstring functions but allows other conversion functions to be available.
The above is the detailed content of Why is \"stoi\" not a member of \'std\' when compiling with MinGW 4.6.1?. For more information, please follow other related articles on the PHP Chinese website!