[英]Issues Getting Intellisense Working with C++14
I am working on a project in C++14, and am having issues getting Intellisense to recognize that my syntax is C++14.我正在使用 C++14 开发一个项目,并且在让 Intellisense 识别我的语法是 C++14 时遇到问题。 I am getting errors like:我收到如下错误:
Even though when I compile with -std=c++14, it works.即使当我使用 -std=c++14 编译时,它也可以工作。
EDIT: The variable name is Replica, as is the class.编辑:变量名称是副本,类也是。 This compiles in C++14.这在 C++14 中编译。 Here is the declaration of variable:这是变量的声明:
Replica Replica(repID, true, false, false, reader, io_context);
EDIT: My apologies, I had changed the above line from:编辑:抱歉,我已将上述行从:
replica replica(repID, true, false, false, reader, io_context);
and did not realize that this is not allowed in C++14.并且没有意识到这在 C++14 中是不允许的。 My apologies, I think the Intellisense is working and this question should be closed.抱歉,我认为 Intellisense 正在工作,这个问题应该被关闭。
I have read the post here: vscode Intellisense not working and I think I have tried everything from the top answers.我在这里阅读了这篇文章: vscode Intellisense not working ,我想我已经尝试了所有顶级答案。
This is what my c_cpp_properties.json
looks like:这就是我的c_cpp_properties.json
样子:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/local/Cellar/boost/1.76.0/include/boost/predef/other"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/usr/bin/g++",
"cStandard": "c11",
"cppStandard": "c++14",
"compilerArgs": [
"-std=c++14"
]
}
],
"version": 4
} }
Please let me know if I should upload more information.如果我应该上传更多信息,请告诉我。
My apologies, the original declaration of replica was:抱歉,副本的原始声明是:
replica replica(repID, true, false, false, reader, io_context);
and I changed it to:我将其更改为:
Replica Replica(repID, true, false, false, reader, io_context);
Of course this required renaming the classes as well.当然,这也需要重命名类。
I thought the former would be allowed in C++14, which made me think Intellisense was incorrectly showing this error.我认为前者在 C++14 中是允许的,这让我认为 Intellisense 错误地显示了这个错误。 It is confusing to me as to why C++14 allows the lower case version and not the upper case version.我很困惑为什么 C++14 允许小写版本而不是大写版本。
This question should be closed.这个问题应该关闭。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.