Web lists-archives.com

Re: [Mingw-users] 'to_string' is not a member of 'std'




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/05/17 18:23, Eli Zaretskii wrote:
> I hit this problem today while building a pretest of GDB 8.0 with
> MinGW.  The compilation errors out like this:
> 
>   cli/cli-script.c: In member function 'std::__cxx11::string user_args::insert_args(const char*) const':
>   cli/cli-script.c:809:16: error: 'to_string' is not a member of 'std'
> 	new_line += std::to_string (m_args.size ());
> 		    ^
> 
> It turns out this is an old issue:
> 
>   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015
> 
> Does anyone know whether the underlying issue with MinGW runtime is
> resolved in the latest mingwrt?

What version of mingwrt are you using now?  This WJFFM:

  $ cat foo.cpp
  #include <string>
  int main() { std::to_string(10); }

  $ mingw32-g++ --version
  mingw32-g++ (GCC) 5.3.0
  Copyright (C) 2015 Free Software Foundation, Inc.
  This is free software; ...

  $ grep VERSION $(dirname $(which mingw32-g++))/../include/_mingw.h
  ...
  #define __MINGW32_VERSION           5000000L

  $ mingw32-g++ -c -std=c++11 -fsyntax-only foo.cpp
  <no diagnostic output here>

  $ mingw32-g++ -c -std=gnu++11 -fsyntax-only foo.cpp
  <no diagnostic output here>

but, if you neglect the C++11 requirement:

  $ mingw32-g++ -c -fsyntax-only foo.cpp
  foo.cpp: In function 'int main()':
  foo.cpp:2:14: error: 'to_string' is not a member of 'std'
   int main() { std::to_string(10); }
                ^

> If so, would it be possible to have an updated distribution of
> gcc-g++-5.3.0-2-mingw32-bin to go with that mingwrt fix, such that
> to_string will now be usable in MinGW builds?

The example above is run with my Linux hosted cross-compiler, which is, 
AFAIK, completely consistent with the current MinGW.org GCC build, and 
the most recent mingwrt-5.0 distribution.

> If the runtime issue is not yet fixed, what would it take to fix it?

Looks to me as if it should work just fine already.

- -- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJZEO1rAAoJEMCtNsY0flo/hNoP/RFRgCi8qT3fGuqtpoRF2+Nd
4UC7gWYcO2yT4btYRgY40P73pUVEhux166+GNKkmvIg4jbNtWJeEmpvYwDmalZfm
jPwsr4ROy4akROaCdgY5B1FLqpwJa8LS3yCP3atAORKYiUgb0BWZkbSy7KsItzEH
uWcCXjvrXOKpn+t9+hHhPV9H/3z8Jh+der7JKKuwfotjkOCpBN0duKn+w51aH7NS
rj6Uc96fpWiOCMF3Bs/KGW+2H0Ol219JTzk4AUBve9TDyZwGobG0BHKk4PdWHrMn
JmlTdC4hn0mFIkzuojWnrXHNCr9YNOqeH0OwysZtdu7Hcnyp41axdx3thrVI+LnW
D3FQOLSOzXgSa6yxQYVQxHzwFgRzoowq7F4xRS7gN6po4v1clbkdRMvO2mWBqsvT
5KRRC8lohxFrpwX0NAifjEE6SebE9h/ACFsIhT7Ka05foNsW/fRp5c+NbXnBPGb2
ww7VyBZ8cPhMFZ0i3pewb4EdoggeZC/wULS2mGrsD0fXmypnoGcgmXo+y4NPBnN2
i+odL3EDTWbsxjoM2Fcp0vSK97VWf9z7/nWVRLbPvIVWvXgIEbfR0HQbeofJmqmc
cY2K8HooeNUA1PaS4Qfs+My1IyHSKtgDow3i/+y5jD6nEFcujhaHYDTWmDb68U0W
BDVpI95ENPwBERbzIuxE
=zGZX
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe