Vscode-arduino: includePath not working in c_cpp_properties.json

Created on 15 Aug 2017  Β·  3Comments  Β·  Source: microsoft/vscode-arduino

I'm not sure if this is how its meant to work but it seems wrong.
Really annoying if you trying to build something that uses third party libraries with dependencies.

I have and include folder in my project with the and have added this to the includePath in my c_cpp_properties.json file.
Therefore I expect to be included.
but i get...

app.ino:1:18: fatal error: test.h: No such file or directory
 #include <test.h>
                  ^
compilation terminated.

Now i can do this.

include "include/test.h" and it works.

But that's no good with you have third party libraries expecting #include <> notation expecting the paths to be working.

I have a folder structure

C:.
β”‚   app.ino
β”‚
β”œβ”€β”€β”€.vscode
β”‚       arduino.json
β”‚       c_cpp_properties.json
β”‚
└───include
        test.h

c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
                "${workspaceRoot}\\include",
                "${workspaceRoot}"
            ],
            "browse": {
                "limitSymbolsToIncludedHeaders": false,
                "path": [
                    "C:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino",
                    "${workspaceRoot}\\include",
                    "${workspaceRoot}"
                ]
            },
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 2
}

test.h

class Test
{
  public:
    void printTest()
    {
        Serial.print("test");
    }
};

and app.ino

#include <test.h>
Test test;

void setup()
{
    Serial.begin(9600);
    test.printTest();
}

void loop()
{

}

Most helpful comment

Well then its kind of useless then for and serious integrated solution.
Basically forget this toy and use Atmel Studio(TM).
Unless of course we should fix it so you can.

On Wed, Aug 16, 2017 at 1:39 PM, Zhang Yuning notifications@github.com
wrote:

c_cpp_properties.json is the config file of the c/c++ extension. It reads
the includePath config to provide correct intellisense. However, the
building done using the Arduino IDE, which follows its own rule to resolve
third party libraries.

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-arduino/issues/392#issuecomment-322638129,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABoM2r97LBuH7L93PbJA3GvSZ2R78qFwks5sYkhNgaJpZM4O3idV
.

--
Justin Romaine
Senior Systems Architect
Spark Dental Technology
justin.[email protected]
ph 021 764 506
hm 09 445 9166

All 3 comments

c_cpp_properties.json is the config file of the c/c++ extension. It reads the includePath config to provide correct intellisense. However, the building done using the Arduino IDE, which follows its own rule to resolve third party libraries.

Well then its kind of useless then for and serious integrated solution.
Basically forget this toy and use Atmel Studio(TM).
Unless of course we should fix it so you can.

On Wed, Aug 16, 2017 at 1:39 PM, Zhang Yuning notifications@github.com
wrote:

c_cpp_properties.json is the config file of the c/c++ extension. It reads
the includePath config to provide correct intellisense. However, the
building done using the Arduino IDE, which follows its own rule to resolve
third party libraries.

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode-arduino/issues/392#issuecomment-322638129,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABoM2r97LBuH7L93PbJA3GvSZ2R78qFwks5sYkhNgaJpZM4O3idV
.

--
Justin Romaine
Senior Systems Architect
Spark Dental Technology
justin.[email protected]
ph 021 764 506
hm 09 445 9166

Duplicate with #438 .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tranvan110 picture tranvan110  Β·  30Comments

mundodisco8 picture mundodisco8  Β·  104Comments

C0rn3j picture C0rn3j  Β·  45Comments

CodeNameHawk picture CodeNameHawk  Β·  67Comments

hellyzh picture hellyzh  Β·  27Comments