如何在 Eclipse 中将 C++11 设置为默认值?
How do you set C++11 as default in eclipse?
是否可以避免必须转到项目设置并为我在 eclipse 中创建的每个项目添加编译标志以使用 C++11,并将 C++11 设置为默认值?
您可以将其设置为给定工作区中的默认值,方法是转到 Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT [Your Compiler] Built-in Compiler Settings
,然后将 -std=c++11
添加到那里的 Command to get compiler specs
。
请注意,为了让项目选择此工作区范围的设置,需要在项目的 Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT [Your Compiler] Built-in Compiler Settings
中选中 Use global provider shared between projects
。
是否可以避免必须转到项目设置并为我在 eclipse 中创建的每个项目添加编译标志以使用 C++11,并将 C++11 设置为默认值?
您可以将其设置为给定工作区中的默认值,方法是转到 Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT [Your Compiler] Built-in Compiler Settings
,然后将 -std=c++11
添加到那里的 Command to get compiler specs
。
请注意,为了让项目选择此工作区范围的设置,需要在项目的 Properties -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT [Your Compiler] Built-in Compiler Settings
中选中 Use global provider shared between projects
。