简体   繁体   English

如何在 Visual Studio(2015) 中设置 C++ 编译器标志

[英]How to set C++ compiler flags in Visual Studio(2015

I want to set some compiler flags in visual studio 2015 for a C++ program but I can't see how.我想在 Visual Studio 2015 中为 C++ 程序设置一些编译器标志,但我看不到如何设置。 Using another IDE (CodeBlocks) I can select the following with a tick box:使用另一个 IDE(代码块),我可以使用复选框选择以下内容:

Have g++ follow the C++11 ISO C++ language standard让 g++ 遵循 C++11 ISO C++ 语言标准

Also, I can create my own new flag (with name, Compiler flags and linker flags set )此外,我可以创建自己的新标志(设置名称、编译器标志和链接器标志)

How can I modify and create these two flags on VS2015 ?如何在 VS2015 上修改和创建这两个标志?

I've checked https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx?f=255&MSPPError=-2147217396 but no luck.我检查过https://msdn.microsoft.com/en-us/library/hhzbb5c8.aspx?f=255&MSPPError=-2147217396但没有运气。

**here is a picture of codeblocks ide and compiler settings **这是代码块ide和编译器设置的图片在此处输入图片说明

**edit here is VS2015 configuration settings **这里编辑的是VS2015配置设置在此处输入图片说明

您可以通过选择项目属性 -> 配置属性 -> C/C++ -> 命令行来添加选项,然后将它们添加到底部的“附加选项”部分。

Qouted from this link.来自链接。

You can set compiler options for each project in its Property Pages dialog box.您可以在其“属性页”对话框中为每个项目设置编译器选项。 In the left pane, select Configuration Properties, C/C++ and then choose the compiler option category.在左窗格中,选择配置属性、C/C++ ,然后选择编译器选项类别。

Update: To add language specification use /std flag.更新:要添加语言规范,请使用/std标志。 Append it at the end of existing flags in Command Line option page.将其附加到命令行选项页面中现有标志的末尾。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 3,如何设置Visual Studio C ++ 2015编译器? - Python 3, How to set Visual Studio C++ 2015 compiler? Visual Studio中的C ++编译器标志 - c++ compiler flags in visual studio C++ 编译器标志,用于在 Visual Studio 中进行分析 - C++ compiler flags for profiling in Visual Studio Visual Studio 2015更新3-C ++编译器错误? - Visual Studio 2015 Update 3 - C++ Compiler bug? 如何将Intel C ++编译器2015与Visual Studio 2012的全新安装集成 - How to integrate Intel C++ compiler 2015 with fresh installation of Visual Studio 2012 如何使用Visual Studio C ++编译器? - How to use Visual Studio C++ Compiler? 如何在 Visual Studio Code 中包含编译器标志? - How to include compiler flags in Visual Studio Code? 设置Visual Studio 2008编译器为C不是C ++ - set visual studio 2008 compiler for c not c++ Visual Studio 2013 和 2015 中的 C++ 编译器错误 C2280“试图引用已删除的函数” - C++ Compiler Error C2280 "attempting to reference a deleted function" in Visual Studio 2013 and 2015 如何为 Visual Studio Compiler 指定自定义编译器标志 - How to specify custom compiler flags for Visual Studio Compiler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM