to_string error (sfml)

I got this error:

 
error LNK2001: Unresolved external symbol ""class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl to_string(int)" (?to_string@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)".


If i use
 
std::string to_string(int a);


with this code:

I used the <vector> function to count some already counted vectors

1
2
3
vector<string> vect1, vect2;

vect1.push_back(to_string(vect2.size()));


I'm using sfml with this code. I codet something similar with the same code without sfml and this was working.

Does someone has a solution?

EDIT:

So std::string to_string(int a) doesn't work with sfml... does anyone know a other way to convert "int" to "string"?
Last edited on
got it:

1
2
3
4
5
6
#include <sstream>
#include <string>

std::ostringstream oss;
oss << value;
std::string str = oss.str();
Topic archived. No new replies allowed.