1. <small id='tPeiX'></small><noframes id='tPeiX'>

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

        如何在 VSCode C++ 扩展中启用 C++17 支持

        时间:2023-08-03

        <tfoot id='ElWpT'></tfoot>
        • <bdo id='ElWpT'></bdo><ul id='ElWpT'></ul>
          • <small id='ElWpT'></small><noframes id='ElWpT'>

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

                1. <legend id='ElWpT'><style id='ElWpT'><dir id='ElWpT'><q id='ElWpT'></q></dir></style></legend>
                  本文介绍了如何在 VSCode C++ 扩展中启用 C++17 支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我一直在 std::string_view 上出现错误曲线,但我能够构建得很好.有没有办法告诉智能感知或 C++ linter 使用 C++17?

                  I keep on getting error squiggles on std::string_view, but I am able to build just fine. Is there a way to tell intellisense or the C++ linter to use C++17?

                  我得到的具体错误是:

                  namespace "std" has no member "string_view"
                  

                  推荐答案

                  现在这变得容易多了.在您的 vs code 扩展设置中搜索 cppstandard,然后从下拉列表中选择您希望扩展使用的 C++ 版本.

                  This has become much easier now. Search for cppstandard in your vs code extension settings and choose the version of C++ you want the extension to use from the drop down.

                  为了确保您的调试器使用相同的版本,请确保您的 tasks.json 具有类似的内容,其中重要的几行是 --std 和之后的行定义版本.

                  In order to make sure your debugger is using the same version, make sure you have something like this for your tasks.json, where the important lines are the --std and the line after that defines the version.

                  {
                    "tasks": [
                      {
                        "type": "cppbuild",
                        "label": "C/C++: g++ build active file",
                        "command": "/usr/bin/g++",
                        "args": [
                          "--std",
                          "c++17",
                          "-I",
                          "${fileDirname}",
                          "-g",
                          "${fileDirname}/*.cpp",
                          "-o",
                          "${workspaceFolder}/out/${fileBasenameNoExtension}.o"
                        ],
                        "options": {
                          "cwd": "${workspaceFolder}"
                        },
                        "problemMatcher": ["$gcc"],
                        "group": {
                          "kind": "build",
                          "isDefault": true
                        }
                      }
                    ],
                    "version": "2.0.0"
                  }
                  

                  请注意,如果您直接复制上述 tasks.json,则您的工作区根目录中需要有一个名为 out 的文件夹.

                  Note that if you're copying the above tasks.json directly, you'll need to have a folder named out in your workspace root.

                  这篇关于如何在 VSCode C++ 扩展中启用 C++17 支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Visual Studio 代码,#include <stdio.h>说“向设置添 下一篇:如何在 Visual Studio Code 中包含编译器标志?

                  相关文章

                  最新文章

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

                    1. <legend id='pomT8'><style id='pomT8'><dir id='pomT8'><q id='pomT8'></q></dir></style></legend>
                        <bdo id='pomT8'></bdo><ul id='pomT8'></ul>

                    2. <tfoot id='pomT8'></tfoot>
                    3. <small id='pomT8'></small><noframes id='pomT8'>