久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

to_string 未在范圍內(nèi)聲明

to_string not declared in scope(to_string 未在范圍內(nèi)聲明)
本文介紹了to_string 未在范圍內(nèi)聲明的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我試圖讓 to_string(NUMBER) 函數(shù)在我的 Ubuntu 計(jì)算機(jī)上工作數(shù)周,但它從來沒有在 QT 環(huán)境或其他任何地方工作過.我的代碼在 Mac osx 上運(yùn)行良好,但是當(dāng)我嘗試在 Ubuntu 中運(yùn)行它時,它抱怨 to_string 未在范圍內(nèi)聲明.對此的任何解決方案將不勝感激.我試圖更新 gcc 編譯器,但它沒有解決問題.請幫忙.

I am trying to make the to_string(NUMBER) function work in my Ubuntu computer for weeks but it never ever works in the QT environment or anywhere else. My code works perfectly on my Mac osx, but when I try running it in Ubuntu it complains that to_string is not declared in scope. Any solutions to this would be greatly appreciated. I have tried to update the gcc compiler but it didn't fix the problem. Please help.

我使用的是 QT Creator 4.8.1,我使用的是 C++ 和最新版本的 Ubuntu.

I am using QT Creator 4.8.1 and I am using C++ and latest version of Ubuntu.

int Bint::operator*(int temp){
    Bint b(to_string(temp));
    return ((*this)*b);
}

我在 pro 文件中遺漏了 QMAKE_CXXFLAGS += -std=c++0x.

I was missing the QMAKE_CXXFLAGS += -std=c++0x in the pro file.

推薦答案

它對您不起作用的原因可能有多種:也許您需要使用 std:: 限定名稱,或者你可能沒有 C++11 支持.

There could be different reasons why it doesn't work for you: perhaps you need to qualify the name with std::, or perhaps you do not have C++11 support.

如果你有 C++11 支持,這有效:

This works, provided you have C++11 support:

#include <string>

int main()
{
  std::string s = std::to_string(42);
}

要使用 g++ 或 clang 啟用 C++11 支持,您需要傳遞選項(xiàng) -std=c++0x.您還可以在這些編譯器的較新版本上使用 -std=c++11.

To enable C++11 support with g++ or clang, you need to pass the option -std=c++0x. You can also use -std=c++11 on the newer versions of those compilers.

這篇關(guān)于to_string 未在范圍內(nèi)聲明的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

What do compilers do with compile-time branching?(編譯器如何處理編譯時分支?)
Can I use if (pointer) instead of if (pointer != NULL)?(我可以使用 if (pointer) 而不是 if (pointer != NULL) 嗎?)
Checking for NULL pointer in C/C++(在 C/C++ 中檢查空指針)
Math-like chaining of the comparison operator - as in, quot;if ( (5lt;jlt;=1) )quot;(比較運(yùn)算符的數(shù)學(xué)式鏈接-如“if((5<j<=1)))
Difference between quot;if constexpr()quot; Vs quot;if()quot;(“if constexpr()之間的區(qū)別與“if())
C++, variable declaration in #39;if#39; expression(C++,if 表達(dá)式中的變量聲明)
主站蜘蛛池模板: 五十女人一级毛片 | 蜜桃在线播放 | 久久99网 | 色悠悠久 | 精品日韩一区 | 精品日韩一区二区 | 久久国产精品首页 | 亚洲一区在线播放 | 在线观看亚洲精品 | 女同久久另类99精品国产 | 中文字幕99 | 亚洲乱码一区二区三区在线观看 | 国产精品国产三级国产aⅴ中文 | 成人国产精品久久 | 青青草原综合久久大伊人精品 | 亚洲精品日韩在线 | 久久91av| 日韩av一区二区在线观看 | 国产高清毛片 | 在线一级片 | 精品视频在线播放 | 色狠狠一区 | 亚洲精品一二三 | 一级免费a | 中文字幕亚洲视频 | 国产成人av在线播放 | 国产专区在线 | 99精品久久久国产一区二区三 | 成人一级黄色毛片 | 一级a爱片久久毛片 | 久久久国产精品入口麻豆 | 在线观看国产视频 | 一区二区视频在线 | xxxxx免费视频 | 91精品久久久久久久久久 | 久久九精品 | 91网站在线播放 | 亚洲国产中文字幕 | 欧美激情精品久久久久久变态 | 国产丝袜一区二区三区免费视频 | av电影一区 |