error:
error: ‘to_ string’ was not declared in this scope
reason:
to_ String is a new function introduced by C + + 11, which may not be supported by the old compiler, so we need to add “C + + 11” compiler support to the compiler
solutions:
gcc compiler under Linux: add the compiler option - STD = C + + 11 to the G + + command line, for example:
g++ -o test test.cpp -std=c++11
CodeBlocks compiler: toolbar opens settings – > Compiler, check C + + 11 standard here( (reference link)
dev C + + compiler: click Tools – > With compile options and the enclosed compiler instructions, the compiler can support the C + + 11 standard( (reference link)
Similar Posts:
- [Solved] codeblocks Error: ‘to_string’ was not declared in this scope
- [Solved] undefined reference to `cv::imread(std::string const&, int)’
- [Solved] IDEA Maven Package Error: [ERROR] javac options source files
- IntelliJ idea error: (24, 35) Java: constant string too long
- GCC refers to math. H header file, and there are some errors such as undefined reference to ` POW ‘when compiling
- [Solved] Undefined reference_G++ _GLIBCXX_USE_CXX11_ ABI compilation error: STD:: Basic_String and STD::__cxx11::basic_String cannot match
- New Maven project — pom.xml error [How to Solve]
- VSCode Use Code Runner plugin can not compile and run the file filename with spaces [How to Solve]
- Android NDK Error: ‘std::string’ has not been declared
- Android Call requires API level 19 (current min is 15)