0

I have been working in c++ for a while and something came up. I tried to include regex header. But compiler won't find the header file.

However, when I try to compile same file using clang++, It compiles and works great.

Sample code I tried was from here

bunkdeath
  • 2,348
  • 5
  • 21
  • 23
  • 2
    Is it giving you an error like this `#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.` by any chance? – Hasturkun Dec 30 '13 at 13:52
  • error I get is 'error: regex: No such file or directory' and rest for all other component from regex used. also when I try 'g++ -std=c++0x -stdlib=libc++' I get error message 'cc1plus: error: unrecognized command line option "-std=c++0x" cc1plus: error: unrecognized command line option "-stdlib=libc++"' – bunkdeath Dec 30 '13 at 13:54
  • also my g++ version is i686-apple-darwin11-llvm-g++-4.2 – bunkdeath Dec 30 '13 at 13:55
  • I suspect this answers your question, sadly. http://stackoverflow.com/a/14229045 – Hasturkun Dec 30 '13 at 13:58

1 Answers1

1

This depends on the C++ library the compiler uses. E.g. for GCC 4.9 regex is now implemented. Options for using C++11 today summarizes this quite well.

Community
  • 1
  • 1
Sebastian
  • 8,046
  • 2
  • 34
  • 58