<legend id='sdC4C'><style id='sdC4C'><dir id='sdC4C'><q id='sdC4C'></q></dir></style></legend>
      <bdo id='sdC4C'></bdo><ul id='sdC4C'></ul>

      1. <tfoot id='sdC4C'></tfoot>

        <small id='sdC4C'></small><noframes id='sdC4C'>

        <i id='sdC4C'><tr id='sdC4C'><dt id='sdC4C'><q id='sdC4C'><span id='sdC4C'><b id='sdC4C'><form id='sdC4C'><ins id='sdC4C'></ins><ul id='sdC4C'></ul><sub id='sdC4C'></sub></form><legend id='sdC4C'></legend><bdo id='sdC4C'><pre id='sdC4C'><center id='sdC4C'></center></pre></bdo></b><th id='sdC4C'></th></span></q></dt></tr></i><div id='sdC4C'><tfoot id='sdC4C'></tfoot><dl id='sdC4C'><fieldset id='sdC4C'></fieldset></dl></div>

        如何在 CLion 中启用 C++11?

        时间:2023-08-28

        1. <i id='JiV4c'><tr id='JiV4c'><dt id='JiV4c'><q id='JiV4c'><span id='JiV4c'><b id='JiV4c'><form id='JiV4c'><ins id='JiV4c'></ins><ul id='JiV4c'></ul><sub id='JiV4c'></sub></form><legend id='JiV4c'></legend><bdo id='JiV4c'><pre id='JiV4c'><center id='JiV4c'></center></pre></bdo></b><th id='JiV4c'></th></span></q></dt></tr></i><div id='JiV4c'><tfoot id='JiV4c'></tfoot><dl id='JiV4c'><fieldset id='JiV4c'></fieldset></dl></div>
            <legend id='JiV4c'><style id='JiV4c'><dir id='JiV4c'><q id='JiV4c'></q></dir></style></legend>

              <tfoot id='JiV4c'></tfoot>

              <small id='JiV4c'></small><noframes id='JiV4c'>

                • <bdo id='JiV4c'></bdo><ul id='JiV4c'></ul>
                    <tbody id='JiV4c'></tbody>
                • 本文介绍了如何在 CLion 中启用 C++11?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 CLion 中运行 C++11 代码,但它不起作用.它说:

                  I'm trying to run C++11 code in CLion but it doesn't work. It says:

                  ...
                      /projects/CLion/untitled/main.cpp:7:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
                  ...
                  

                  我尝试将 CMAKE_C_FLAGS 设置为 -std=c++11-std=gnu++11 但我仍然有同样的问题.常规 C++ 代码编译良好.

                  I tried to set CMAKE_C_FLAGS to -std=c++11 or -std=gnu++11 but I still have the same problem. Regular C++ code compiles fine.

                  我必须在 CLion 的 CMake 窗口中设置什么标志来编译我的 C++11 代码?

                  What flag do I have to set in CLion's CMake window to compile my C++11 code?

                  推荐答案

                  我尝试设置 CMAKE_C_FLAGS

                  I tried to set CMAKE_C_FLAGS

                  根据文档,CMAKE_C_FLAGS为所有构建类型设置 C 语言标志.对于 C++,您需要使用 CMAKE_CXX_FLAGS 代替:

                  According to the documentation the CMAKE_C_FLAGS set C language flags for all build types. For C++ you need use CMAKE_CXX_FLAGS instead:

                  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
                  

                  这篇关于如何在 CLion 中启用 C++11?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Windows 上的 Cmake 中为调试和发布构建链接不同的库? 下一篇:CMake 找不到 Visual C++ 编译器

                  相关文章

                • <tfoot id='H5uK8'></tfoot>

                    <legend id='H5uK8'><style id='H5uK8'><dir id='H5uK8'><q id='H5uK8'></q></dir></style></legend>

                    <small id='H5uK8'></small><noframes id='H5uK8'>

                    <i id='H5uK8'><tr id='H5uK8'><dt id='H5uK8'><q id='H5uK8'><span id='H5uK8'><b id='H5uK8'><form id='H5uK8'><ins id='H5uK8'></ins><ul id='H5uK8'></ul><sub id='H5uK8'></sub></form><legend id='H5uK8'></legend><bdo id='H5uK8'><pre id='H5uK8'><center id='H5uK8'></center></pre></bdo></b><th id='H5uK8'></th></span></q></dt></tr></i><div id='H5uK8'><tfoot id='H5uK8'></tfoot><dl id='H5uK8'><fieldset id='H5uK8'></fieldset></dl></div>
                    • <bdo id='H5uK8'></bdo><ul id='H5uK8'></ul>