Default flags for gcc compiler in Eclipse

前端 未结 5 410
孤城傲影
孤城傲影 2020-12-21 04:54

I want all my C programs to be compiled with the options -Wall -pedantic -ansi by default. Is there a way to have Eclipse add these flags to the compiler comman

5条回答
  •  执笔经年
    2020-12-21 05:34

    Eclipse on Windows: For a project: Properties -> C/C++ Build -> Setting than "Tool Setting" tab. select "CGG C++ Compiler" than at the right side you will see Command : g++ modify it to Command: g++ CFLAGS for instance if you like to have C++11 support modify as Command: g++ --std=c++11

    PS: This modification will valid for only current project and for only current configuration. If you want it for all configurations modify each configuration (Run, Debug) similarly.

提交回复
热议问题