Some problems to build TGUI after your last commit

Started by gupas, 31 July 2013, 11:07:45

gupas

Hello,

I just tried to build the last version of TGUI, but...

C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'sf::Color tgui::extractColor(std::string)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:60:27: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:68:33: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:76:36: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:80:37: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:85:36: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'std::string tgui::convertColorToString(const sf::Color&)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:108:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:109:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:110:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:111:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:114:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:115:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:116:26: error: 'to_string' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'bool tgui::extractVector2f(std::string, tgui::Vector2f&)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:139:32: error: 'stof' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:143:32: error: 'stof' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'bool tgui::extractVector2u(std::string, tgui::Vector2u&)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:173:58: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:177:58: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'bool tgui::extractVector4u(std::string, tgui::Vector4u&)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:207:33: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:215:37: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:223:41: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:227:41: error: 'stoi' is not a member of 'std'
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp: In function 'std::string tgui::convertColorToString(const sf::Color&)':
C:\Users\gupas\Desktop\TGUI\src\TGUI\TGUI.cpp:118:5: warning: control reaches end of non-void function [-Wreturn-type]


But I don't know what is wrong...
(I used CodeBlocks/Mingw)
Should I use SFML compiled with c++11 now? It is strange, but until your last commit it worked great with "only" the -std=c++0x option enabled.

netrick

It's bug in mingw. There is workaround on the web (just download and copy paste few files). Or you can use visual c++

texus

Damn, thats what you get when coding on linux with gcc 4.8 installed.

I'll revert that part of the commit. After searching, it seems like there are problems with MinGW and these function. They are not yet supported without patching the compiler.

Edit: I can't force everone to install an extra patch just to use tgui, so I'll just won't use the functions.

netrick

Texus, it works on linux gcc 4.6. Mingw 4.7 is just lagged behind....

gupas

netrick: I have personally no problem if I need to install a patch, but texus is right: a lib should avoid depend of such things.
to_string and sto* functions are not very importants (and custom functions can easily do the same).
texus: ok. Thanks for your answer.

texus


netrick

I still don't get why old c++ standard doesn't have string-numeric conversion by default... It's so damn important and every app use it basically. It's very easy to write it yourself with template function using string streams, but still...