std::to_string不是使用CygWin的C++11中的成员
std::to_string not a member in C++11 using 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);
我错过了什么?我该如何使用这种方式响铃?
从CYGWIN标头来看,似乎对于C++11,除非定义了_GLIBCXX_USE_C99
,否则不会定义它们。它们包含在if:中
#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
我尝试定义_GLIBCXX_USE_C99
,但这对我的项目不起作用。您可以在使用字符串标头之前尝试定义它。
我最近在CYGWIN上遇到了一个与__STRICT_ANSI__
有关的类似问题
相关文章:
- Windows/Cygwin - 不能使用 pybind11 - 犯错误
- MSVC是否支持C++11样式的属性而不是__declspec
- 创建LinkedList退出,返回代码为-11(SIGSEGV)
- 我可以将一个用clang c++11编译的对象与另一个用c++17编译的对象链接起来吗
- 继承:构造函数,初始化C++11中基类的类C数组成员
- 如何将模板转换为C++11之前的模板
- c++11评估顺序(未定义的行为)
- C++中的VLA,扩展名为std=C++11
- 在cygwin中运行c++脚本时发生错误
- 代码在我的计算机上运行良好,但是在将其提交给coursera时遇到未知的信号11问题
- "类模板示例<int>;"语句对 C++11 是什么意思?
- 在cygwin中测试新的boost安装时出现cpp错误
- this_thread::sleep_for和计时时钟之间的关系是否由C++11标准指定
- 如何使用lock_guard在c++11中实现scoped_lock功能
- C++11 中不同类型的对象的 std::array 的替代方案
- 为什么 -mmacosx-version-min=10.10 不阻止使用标记为从 10.11 开始的函数?
- 为什么我的C++代码中出现'Segmentation Fault: 11'行?
- 用C++11在Cygwin上叮当
- std::to_string不是使用CygWin的C++11中的成员
- cygwin上的gcc 4.7.3支持c++ 11并发特性吗?