ubnt解决方案
查看: 1825|回复: 2

opwenwrt交叉编译

[复制链接]

5

回帖

462

积分

4 小时

在线时间

少尉

注册时间
2016-9-28
金币
449 个
威望
1 个
荣誉
0 个
累计签到:6 天
连续签到:0 天
[LV.20]漫游旅程
发表于 2016-9-30 11:04 |显示全部楼层
100金币
源码为c++,其中使用了std::to_string()函数
交叉编译的g++ version是4.8.几支持c++11,makefile中也加入了-std=c++11的选项但一直出现:“to_string” is not a member of 'std'
求大神告知原因和相关的解决方案呐

附件: 您需要 登录 才可以下载或查看,没有账号?注册

1

回帖

28

积分

4 小时

在线时间

新兵上阵

注册时间
2012-9-2
金币
27 个
威望
0 个
荣誉
0 个
累计签到:2 天
连续签到:0 天
[LV.20]漫游旅程
发表于 2016-11-11 17:38 |显示全部楼层
#include <string>
#include <sstream>

namespace patch
{
    template < typename T > std::string to_string( const T& n )
    {
        std:stringstream 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
回复

使用道具 举报

244

回帖

7330

积分

496 小时

在线时间

中校

注册时间
2012-6-22
金币
7032 个
威望
0 个
荣誉
0 个
累计签到:771 天
连续签到:0 天
[LV.1095]铁杆粉丝
发表于 2016-11-11 18:55 |显示全部楼层
不是明明白白告诉你了吗。test1.cpp
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册 微信登录

本版积分规则

站点统计 | Archiver | 手机版 | 无线门户 ( 粤ICP备11076993号|粤公网安备44010602008359号 ) |网站地图

GMT+8, 2024-4-27 06:05

返回顶部 返回列表