0

in centos eclipse. Got a bug says "function runtime_error could not be resolved". I added -std=c++11 or -std=c++0x in the settings and rebuild the index. (see Multiple "could not be resolved" problems using Eclipse with minGW ) it still shows a bug in the CDT. But in my makefile I added -std=c++0x it got compiled with no error.

the line has the bug is throw runtime_error("error msg"); I included those header files

    #include <cerrno>
    #include <system_error>
    using namespace std;
    void main()
    {
         throw runtime_error("blabla");
    }
Community
  • 1
  • 1
chans
  • 109
  • 1
  • 9
  • in the code I also used using namespace std; or you can add std::runtime_error("...."); – chans Dec 16 '15 at 16:56
  • in the code you can add std:: it hints the selections has "__throw_runtime_error()", when I use it, it has compile error "error: invalid use of ‘void’" – chans Dec 16 '15 at 17:03
  • the code change to __throw_runtime_error(" "); from throw runtime_error(" "); it compiled. – chans Dec 16 '15 at 17:06

0 Answers0