How to change compiler options of build in Eclipse CDT

How to add compiler flag in Eclipse CDT
How to set compiler flag in Eclipse CDT

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s