acharluk / easy-cpp-projects

Repo for Easy C++ Project extension for Visual Studio Code
37 stars 21 forks source link

[Question] Unable to fix include path errors #18

Open JakeHadley opened 5 years ago

JakeHadley commented 5 years ago

I'm having an issue having intellisense find header files in the same folder as the source code.

My project is setup like this:

projectDir
---.vscode
---subDir
------src
---------main.cpp
---------header.h

I know it works because it compiles, but it's a problem with intellisense not picking it up. I have a c_cpp_properties.json file:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",            
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++14",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

What am I missing?

acharluk commented 5 years ago

I just tried a setup like yours with a source and header files inside a subdirectory and the intellisense seems to work just fine with a newly generated project. I tried this without a c_cpp_properties.json file on Linux.

Easy C++ Projects does not provide c_cpp_properties.json, so this may be a problem with the C/C++ extension itself.

image