简体   繁体   中英

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. I am getting errors like: 在此处输入图像描述

Even though when I compile with -std=c++14, it works.

EDIT: The variable name is Replica, as is the class. This compiles in 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. My apologies, I think the Intellisense is working and this question should be closed.

I have read the post here: vscode Intellisense not working and I think I have tried everything from the top answers.

This is what my c_cpp_properties.json looks like:

{
"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. It is confusing to me as to why C++14 allows the lower case version and not the upper case version.

This question should be closed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM