c++eclipsec++11makefile

How to set -std=c++0x in compiler option in eclipse makefile project?


I need to set the compiler options in my makefile project in eclipse.

I followed this instruction: http://www.eclipse.org/forums/index.php/mv/msg/282618/787571/ where the last part states:

Obviously make sure your rule includes "-std=c++0x" as a compiler option.

But there are no "tool-settings" in the project properties of my makefile project.

Is there another way to set the compiler options for a makefile project?


Solution

  • If it's a makefile project, then the makefile specifies how to build it, not the Eclipse settings.

    Exactly how to specify the compiler options depends on how the makefile is written, but typically they are in a variable called CXXFLAGS, since that's what the default C++ build rule uses.

    Unless you need to support outdated compilers, I suggest specifying c++11 rather than c++0x.