Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to change compiler options of build in Eclipse CDT

📅 2014-Jan-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

[caption id="attachment_4188" align="aligncenter" width="640"][How to add compiler flag in Eclipse CDT](http://codeyarns.files.wordpress.com/2014/01/20140127-eclipse-compiler-flag.gif) How to set compiler flag in Eclipse CDT[/caption]

Sometimes you may want to add a specific compiler flag to the build commands used to build your code by Eclipse CDT. For example, say you want to add the -std=c++11 flag to build your code. Adding this is easy:

  1. Go to Project > Properties > C/C++ Build > Settings > Cross G++ Compiler > Miscellaneous

  2. In the Other flags entry, append your flag. In this case, we append -std=c++11

That is it! Eclipse CDT will use this flag to compile your code.

Tried with: Eclipse CDT 3.7.2