opwenwrt交叉编译
源码为c++,其中使用了std::to_string()函数
交叉编译的g++ version是4.8.几支持c++11,makefile中也加入了-std=c++11的选项但一直出现:“to_string” is not a member of 'std'
求大神告知原因和相关的解决方案呐:loveliness:
#include <string>
#include <sstream>
namespace patch
{
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
}
#include <iostream>
int main()
{
std::cout << patch::to_string(1234) << '\n' << patch::to_string(1234.56) << '\n' ;
}
http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-g 不是明明白白告诉你了吗。test1.cpp
页:
[1]