PlatformIO Community

"#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit"

I have just made a new project in Platformio IDE to test some GPIO on an ESP32-EVB and I can’t build nor upload the sketch because #include <Arduino.h> returns the following errors:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/george/Documents/PlatformIO/Projects/ESP32-EVB-foo/src/main.cpp).
cannot open source file "Arduino.h"
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/george/Documents/PlatformIO/Projects/ESP32-EVB-foo/src/main.cpp).
cannot open source file "Arduino.h"

This is rather strange, because it isn’t the first project I make. I have never edited includePath. In fact I have no idea where to find it, how it looks or how to modify it. In the past, I’ve fixed my includePath errors by simply deleting .vscode folder and reopening VSCode. But this trick doesn’t work right now.

For reference, this is the code:

#include <Arduino.h>

#define GPIO_ 2

void setup() {
  Serial.begin(115200);
  pinMode(GPIO_, INPUT_PULLUP);
  digitalWrite(GPIO_, HIGH);
  delay(100);
  Serial.print("In Setup: ");
  Serial.println(digitalRead(GPIO_));
}

void loop() {
  delay(1000);
  Serial.print("In Loop: ");
  Serial.println(digitalRead(GPIO_));
}

and this is platformio.ini :

[env:esp32-evb]
platform = espressif32
board = esp32-evb
framework = arduino
board_build.flash_mode = qio
board_build.f_flash = 80000000L
upload_port = /dev/ttyUSB0
monitor_port = /dev/ttyUSB0
monitor_speed = 115200
upload_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=5

What can I do ?

1 Like

Can you give this a try, and see if it ‘fixes’ it? The last and third last (linked) posts are the important ones at the moment - disabling auto updates and reverting the version of the C/C++ extension.

I’ve actually fixed it by opening a New Window and then Open Project from Platformio IDE. It seems that a new Workspace saved the day.

From what I can see, this includePath thingy can cause a lot of trouble and there is no real fix to it. These are tricks to make it work.

1 Like

lol… yes, that is the usual fix. Unless it’s an actual bug in PlatformIO, given that it took about 5 months for them to fix a ‘simple’ keyboard focus issue, this could be … interesting? A lot of the time I just ignore the red sqiggles if they are for #includes and the problems tab entirely and they seem to go away after a while! :laughing:

A lot of the time I just ignore the red swiggles if they are for #includes and the problems tab entirely and they seem to go away after a while! :laughing:

Ha! Same here… I had this happen to me again this morning. I went back to check the C++ plugin version and it was still .26, so I closed PIO, opened the project back up, and everything was fine.

I just wanted to mention that the last time this happened it was after I copied and moved the project directory to a new location… Not sure if that is valuable information or not.

1 Like

PLaese reopening on a super simple project … means this platformIO project is WRITTTEN HORROBLY INSTABLE DO NOT RISK DOING
simple test using PLATFORM IO it CAN NOT HANDLE the simplest of things
without OBSUCRING EVERYTHING !!!

EXPLAIN  WHAT ARE  SQUIGLES       reopening =INSTABILITY = VERRY BAD PROGRAMMING

The ‘red squiggles’ the IntelliSense ‘error detection’ are provided by the C/C++ Microsoft VSCode extension, not by PlatformIO. Do not confuse the two. It is either failing due to it not parsing your project correctly, a mis-configuration in the c_cpp_properties.json file (either manual or automatic), or due to it choking up once again.

image

Sorry GET THE ERROR IN platformio. NO embrella policy …its the other one

THIS IERROR IS AT MOST A BAD SYNCHRONISATION BETWEEN PLATFORM IO and VSCODE… the proposed environment !!!

FIND or propose a way to REALY IMPROVE THE SYNC between both or ELLIMINATE intellisens (is counter productiev anyhow ??? Essential part!!!)

As advise is to erase .VSCODE containing C_CPPPROPERTIES.json

modifying this code (auto generated ) IS BAD please CORRECT Before trowing a product to a consumer … Talking about misconfiguration is a waste …
CORRECTING is the way to go …

PLease advise in the correct POSITIVE SENSE …

Please pay for support(https://platformio.org/support) if you want to have a special treatment and explain your problems in full English sentences, so that an external person can provide appropriate help and in order not to waste their free time, as they do this kind of support seemingly for free.

It is counter productive to write all of your sentences in capslock, as I for example would avoid answering any question of people who have such an attitude.

PlatformIO is provided for free, so I would guess you are not a consumer, but at most a user.

1 Like

Yesterday Platformio updated as I was about to make some minor changes to a config.h file for MArlin 2.0.4. Now I cannot compile anything. I keep getting the same error as the OP.
“message”: “#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\…\Marlin-2.0.x\Marlin\src\MarlinCore.cpp).”,
I have tried the opening new windows, deleting the .vscode folder.
I also went back to the original config.h and config_adv.h and those will not compile either, even tho there have compiled on various other occasions. I have used Platformio for ~ 6 months now and never had an issue like this.
Please help! Thanks

1 Like

The error message #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit is not from the build process but from Intellisense.

As a first step, the build process should be checked (and Intellisense should be ignored for the moment). So can you run the Build task (click the build icon in the status bar) and verify that the code compiles successfully. If not, provide the log output from TERMINAL view.

1 Like

So no, there is no check for Build, so not able to build because there are two errors/problems noted. Here are the errors:
configuration_adv.h
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\Documents\3D\BTT-SKR+Cohesion3D Files\Marlin-2.0.4.4.x\Marlin-2.0.x\Marlin\src\MarlinCore.cpp).
configuration.h
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\Documents\3D\BTT-SKR+Cohesion3D Files\Marlin-2.0.4.4.x\Marlin-2.0.x\Marlin\src\MarlinCore.cpp).

Not sure what you mean by provide the log output from Terminal view. If I go to Terminal view, all I get is this:
Windows PowerShell
Copyright © Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS D:\Documents\3D\BTT-SKR+Cohesion3D Files\Marlin-2.0.4.4.x>

Please let me know any other info you need, or ideas on how to solve. I have historically had not problems Building until a few days ago.
Thanks! Bill

I tried several of the further above fixes previously, but I tried again deleting the .vsco folder, and opened into a new workspace, and not I do not have the issues I described above. I really do appreciate your support on this matter! Thanks!

What do you mean by that? I don’t understand it.

Ignore the squiggly line and try to build the project by clicking the check mark in the status bar:

image

The build process will output the log in the TERMINAL view. If the build fails, post the entire log here.

And please format log output as code, by either selecting the text and clicking the </> icon or by enclosing it in triple backquotes (``` on separate lines).

1 Like

Please note my previous comment, this has been resolved.

While your issue is now resolved, please keep what Manuel said in mind for the future, as just because there are entries in the ‘Problems’ tab, this does NOT necessarily mean your project/code will fail to build. As Intellisense problems ARE NOT compile errors. If intellisense is not working properly, you will get entries in the problems tab, and the red squiggles, even though you code builds just fine.

Sure, I understand that, however as in my first post, there were NO Build etc icons at all. The icons at the bottom left were very limited.

1 Like

Fair enough… if they’re not there, they’re not there! :laughing:

So for some reason PlatformIO didn’t recognise there to be a valid project folder open. I’m pretty sure it just needs a platformio.ini in the folder to make that determination, so perhaps the wrong folder was open? Either way, it’s working now, so enjoy! :wink:

That is entirely possible! I am have only been using Platformio since Marlin 2.0Bugfix. I’ll keep your comment in mind in case it ever happens again. Great responses in this group - Thanks

1 Like

I had the same problem. I fixed it in the code. Don’t know if it’s the same for you, but here’s what I found:
I had the same include file included twice because the include statement was buried in another include file. I fixed that and the problem went away.

The way I fixed it was to put the following at the top and bottom of ALL include files:
At the top:
#ifndef TEENSY_ADS1115_H
#define TEENSY_ADS1115_H

The variable defined is best to look somewhat like the name of the include file in this case, teensy_ads1115.h

At the bottom:
#endif

This way, if the include file has already been included, the second include sees (in this case) TEENSY_ADS1115_H already defined, making the second instance of the include resolve to nothing.

I hope this helps somebody.