From: SF/projects/mingw n. l. <min...@li...> - 2012-10-23 12:47:04
|
Bugs item #3413241, was opened at 2011-09-23 02:53 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3413241&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc >Group: Aged issue >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: kartfish (kartfish) Assigned to: Nobody/Anonymous (nobody) Summary: `to_string` is not a member of `std` Initial Comment: Hello all. gcc --version: gcc.exe (GCC) 4.6.1 mingw-get --version: mingw-get version 0.3-alpha-2.1 $ g++ to_string.cpp -o to_string.exe -std=c++0x to_string.cpp: In function 'int main(int, char**)': to_string.cpp:5:23: error: 'to_string' is not a member of 'std' Source code (to_string.cpp): #include <iostream> #include <string> int main(int argc, char **argv) { std::string number = std::to_string(42); std::cout << number << std::endl; return 0; } ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2012-10-23 05:47 Message: Still unresolved at GCC. This is dependent on the GCC issue. ---------------------------------------------------------------------- Comment By: eXpl0it3r (expl0it3r) Date: 2012-09-13 12:27 Message: Bug did already exist as well, cross referencing: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015 ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2012-09-13 09:49 Message: It would be better to report this to the GCC bugs list. Currently we do not have a member working on upstream GCC. ---------------------------------------------------------------------- Comment By: eXpl0it3r (expl0it3r) Date: 2012-09-13 08:14 Message: Forgot to add the authors name and a mirror to the files. Author: Julian Smythe Mirror: http://my-gate.net/pub/mingw-to-string-gcc47.zip ---------------------------------------------------------------------- Comment By: eXpl0it3r (expl0it3r) Date: 2012-09-13 08:11 Message: Unfortunately this issue still exists after one year... With Google I've found that someone has written a fix for MinGW 4.7.0 and it works flawlessly. http://tehsausage.com/mingw-to-string And since I don't know how long that website will be up, I'll add the explanation here with the files: _______________________________________ 24 August 2012, 11:16 UTC This patch enables the following list of C++11 functions and templates in the std namespace: stoi, stol, stoul, stoll, stof, stod, stold, to_string, to_wstring This assumes you are using the official MinGW distribution. If you are applying this patch to a version of MinGW GCC later than 4.7, you should examine and apply the patches rather than using the zip file. * Download mingw-to-string-gcc47.zip which contains three patched header files. (Original patches: wchar.h, stdio.h, os_defines.h) * Copy wchar.h and stdio.h from the include directory in the zip file to the following directory (overwrite): C:\mingw\include (replace C:\mingw\ with the appropriate directory) * Copy os_defines.h to the following directory (overwrite): C:\mingw\lib\gcc\mingw32\4.7.0\include\c++\mingw32\bits (replace C:\mingw\ with the appropriate directory) (replace 4.7.0 with the correct version number) ---------------------------------------------------------------------- Comment By: kartfish (kartfish) Date: 2011-09-24 00:19 Message: Correction: file: \lib\gcc\mingw32\4.6.1\include\c++\mingw32\bits\os_defines.h ---------------------------------------------------------------------- Comment By: kartfish (kartfish) Date: 2011-09-24 00:17 Message: After digging deeper, the problem is caused by the file/macro: \lib\gcc\mingw32\4.6.1\include\c++\mingw32\bits #define _GLIBCXX_HAVE_BROKEN_VSWPRINTF 1 Of course merely commenting this out doesn't fix the issue. The compiler complains about not finding some vswprintf function. Also this comment: // See libstdc++/37522. reveals that this bug is from 2008, GCC 4.4.0. Time to fix it? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3413241&group_id=2435 |