Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include file not found in include path. Unless it was opened already. #842

Closed
iFreilicht opened this issue Jun 23, 2017 · 2 comments
Closed

Comments

@iFreilicht
Copy link

I'm using the C/C++ and Arduino extension to program for an Arduino Micro.

Extensions

When opening the Arduino core files, I get error messages like these:

Includes
Includes with error message

In this example, inttypes.h, stddef.h and avr/io.h all sit in the same parent folder "G:\Programme\Arduino\hardware\tools\avr\avr\include", which is included in my c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "G:\\Programme\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
                "G:\\Programme\\Arduino\\hardware\\arduino\\avr\\variants\\micro",
                "G:\\Programme\\Arduino\\hardware\\tools\\avr\\avr\\include"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "G:\\Programme\\Arduino\\hardware\\arduino\\avr\\cores\\arduino"
                ]
            }
        }
    ]
}

I can navigate to that folder and verify that all those files are there. In the case of inttypes.h, I even opened the file in VSCode, and after doing that reloading the VSCode window, the red squiggles under any occurence of #include <inttypes.h> vanished. This seems to be 100% repeatable. Even when I then close the file and reload the window, the error won't re-appear.

This leads me to believe that VSCode/Intellisense is somehow caching these files in a hidden location, but doesn't fill up that cache when changes to c_cpp_properties.json were made.

I also tried restarting VSCode completely, but that didn't help either. Am I maybe doing something wrong?

@sean-mcmanus
Copy link
Contributor

You appear to be using the intelliSenseEngine "Tag Parser", which uses the browse.path setting instead of the "includePath" setting, so it seems like you should add paths to the browse.path.

@iFreilicht
Copy link
Author

@sean-mcmanus that was it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants