1

As in title. Will it be default or to use C++11 features we will always have to add -std=c++11?

Right now, because of this option, C++11 still feels like some extra, non-standard thing.

To specify compiler, -std=c++11 flag is used by clang, g++ and even ICC.

mip
  • 8,355
  • 6
  • 53
  • 72

1 Answers1

5

With g++, use -dumpspecs to generate a specs file. Use -print-search-dirs and first line is where to place specs file. Add the -std=c++11 option appropriate place in specs file, on the line following *cc1plus:.

Cheers and hth. - Alf
  • 142,714
  • 15
  • 209
  • 331
  • What do you put in the specs file? I keep getting `fatal error: specs file malformed after 2409 characters`. I tied a few things like: `std=c++11` and `-std=c++11` and `c++11` to no avail. – Galik Dec 01 '14 at 11:51
  • just `-std=c++11` works with MinGW g++ in Windows. don't know in Unix-land, but probably the same. the only real difference is with paths, they shouldn't be quoted and backslashes must be escaped with backslashes. – Cheers and hth. - Alf Dec 01 '14 at 11:54
  • Thnx, works now. No idea why it didn't work for me before I must have mistyped something. – Galik Dec 01 '14 at 12:48
  • Maybe you added extra blank line or something. Blank lines are significant in specs files. And for that matter in network protocols. – Cheers and hth. - Alf Dec 01 '14 at 13:16