如何在VSCode C ++扩展中启用C ++ 17支持 [英] How to enable C++17 support in VSCode C++ Extension

查看:2368
本文介绍了如何在VSCode C ++扩展中启用C ++ 17支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在std :: string_view上遇到错误提示,但是我能够很好地构建。有没有办法告诉intellisense或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"


推荐答案

在GitHub问题跟踪器中有关于此的帖子: std :: string_view智能感知丢失(CMake,VC ++ 2017)

There's a posting in their GitHub issue tracker about this: std::string_view intellisense missing (CMake, VC++ 2017).

在另一个问题中,据说扩展名默认为C ++ 17,但尚不支持所有C ++ 17功能:设置C ++标准

In another issue, it is said that the extension defaults to C++17, but does not yet support all of C++17 features: Setting C++ standard.

这已通过 c_cpp_properties.json参考指南,其中列出了一个选项 cppStandard ,该选项默认转换为C ++ 17。 (要编辑此文件,请按 Ctrl + Shift + P 并键入 C / CPP:编辑配置)。

This is confirmed by c_cpp_properties.json Reference Guide, where an option is listed cppStandard which defaults to C++17. (To edit this file, press Ctrl + Shift + P and type in C/CPP: Edit Configurations).

然后,他们似乎还没有完全的支持。

It appears, then, they just don't have full support yet.

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆