я следующий код ...станд :: to_string не член в C++ 11 с помощью Cygwin
// My.h
#include <string>
....
// My.cpp
#include "My.h"
...
errMsg = "X value [too low]: " + std::to_string(xInVal);
Но когда я компилирую как ...
//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
Я получаю следующая ошибка ....
error: ‘to_string’ is not a member of ‘std’
errMsg = "X value [too low]: " + std::to_string(xInVal);
Что мне не хватает, как использовать to_string таким образом?
возможно боян http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of -std-says-so-g – Jackie
Какую версию GCC вы используете ('gcc -version')? –
версия 4.9.3 (x64) – Jackie