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

to_string 未在范圍內聲明

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

問題描述

我試圖讓 to_string(NUMBER) 函數在我的 Ubuntu 計算機上工作數周,但它從來沒有在 QT 環境或其他任何地方工作過.我的代碼在 Mac osx 上運行良好,但是當我嘗試在 Ubuntu 中運行它時,它抱怨 to_string 未在范圍內聲明.對此的任何解決方案將不勝感激.我試圖更新 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 支持,您需要傳遞選項 -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.

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

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

相關文檔推薦

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;(比較運算符的數學式鏈接-如“if((5<j<=1)))
Difference between quot;if constexpr()quot; Vs quot;if()quot;(“if constexpr()之間的區別與“if())
C++, variable declaration in #39;if#39; expression(C++,if 表達式中的變量聲明)
主站蜘蛛池模板: 亚洲黄色大片 | 狠狠做深爱婷婷久久综合一区 | 国产91丝袜在线播放 | 色婷婷狠狠 | 日韩综合在线 | 黄色网址在线免费观看 | av老司机在线 | 嫩草一区 | 国产成人久久精品麻豆二区 | 超碰成人av | 丝袜美腿一区二区三区 | 久久亚洲免费视频 | 日韩精品视频在线免费观看 | 国产精品福利在线观看 | 免费黄色一级视频 | 亚洲国产欧美日韩在线 | 激情影院在线观看 | 一区免费视频 | 玖玖精品视频 | 成年人免费看视频 | 欧美一级艳片视频免费观看 | 亚洲成人二区 | 一本伊人 | 四虎影院在线 | 亚洲男人av| 日韩av在线免费观看 | 欧美在线激情 | 国产一区二区欧美 | 欧美伦理一区二区 | 免费h片| 艳妇乳肉豪妇荡乳 | 欧美啪啪网 | 久久久久久久久久久国产 | 欧美精品在线免费观看 | 午夜aaa| 日韩精品在线看 | 国产精品一区二区av | 国产日韩欧美精品 | 欧美日韩免费视频 | 欧美日韩久久久 | 欧美色图在线观看 |