mardi 29 décembre 2015

std::to_string not a member in C++11 using CygWin

I have the following code...

// My.h
#include <string>
....

// My.cpp
#include "My.h"
...
errMsg = "X value [too low]: " + std::to_string(xInVal);

But when I compile like...

//setup.py
extra_compile_args =['-std=c++11']

//console output
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -I./My -c ./My.cpp -o build/temp.cygwin-2.2.1-x86_64-3.4/./My.o -std=c++11

I get the following error....

 error: ‘to_string’ is not a member of ‘std’
   errMsg = "X value [too low]: " + std::to_string(xInVal);

What am I missing how do I use to_string in this way?

Aucun commentaire:

Enregistrer un commentaire