std::stoi Issue in MinGW 4.6.1
Upon attempting to compile a program utilizing std::stoi, std::stoul, and related functions with MinGW 4.6.1, an error is encountered indicating that these functions are not recognized as members of std. This issue arises due to the non-standard declaration of vswprintf on Windows platforms.
The GNU Standard Library sets the macro _GLIBCXX_HAVE_BROKEN_VSWPRINTF, which disables the conversion functions used. This macro effectively disables the conversion functions used. For an in-depth understanding of the issue, refer to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37522.
To address this issue, users may modify the header files distributed with MinGW. This can involve removing the !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF) macro from line 2754 of .../lib/gcc/mingw32/4.6.1/include/c /bits/basic_string.h. Additionally, add the macro back around lines 2905 to 2965, which reference std::vswprintf. This modification will enable the availability of conversion functions, excluding std::to_wstring functions.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3