PlatformIO Community

Error in c_cpp_properties.json and main.cpp files after installing PIO


#1

Hi all)))
I’m beginner with PlatformIO program and sorry if my question have been repeated but I haven’t found the solution(
I installed this program on VS Code created new project and discovered three problems:

  • in c_cpp_properties.json file

Path is not a directory: “C:\Users\Green Eagle.platformio\packages\toolchain-atmelavr\bin\avr-gcc.exe”.

But file avr-gcc.exe is a directory!)))

this was underlined by a wavy line

"compilerPath": "C:/Users/Green Eagle/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe -mmcu=atmega1280"
  • and two problems in main.cpp

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (C:\Users\Green Eagle\Documents\PlatformIO\Projects\111\src\main.cpp) will be provided by the Tag Parser.

cannot open source file “stdlib.h” (dependency of “Arduino.h”)

VS Code offered me to fix the mistake that https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Getting%20started%20with%20IntelliSense%20configuration.md#configuring-includepath-for-better-intellisense-results but this link doesn’t contain my mistake(I think)) haha)

how can I fix this situation?
Sorry that I didn’t understand how to solve the such simple question

Thank you very much)))))


#2

The include path warning (and it is only a warning, it shouldn’t be stopping you from working on your code) started appearing after a recent update to the Microsoft C/C++ Extension for VSCode, and Ivan is trying to get the bottom of it and get it fixed over there…

As far as the problems in main.cpp, it’s hard to tell exactly what is causing that without knowing the content of your platformio.ini and main.cpp files…


#3

Hi)))
Thank for answering on my question)
This is my main.cpp


#4

And platformii.ini


#5

Ok, so the mega1280 is compiling fine for me on Linux with an empty sketch.

Do you have any extensions installed other than the C/C++ and PlatformIO IDE? If there is anything that does clang formatting, IntelliSense, etc, that may be interacting strangely.

Otherwise, I would suggest you close VSCode, delete C:/Users/Green Eagle/.platformio/ and let the PlatformIO IDE extension re-install the platform when you restart VSCode.


#6

It’s fixed in the latest development version of PIO Core. Please set platformio-ide.useBuiltinPIOCore to true and restart VSCode. Does it work now?


#7

Hello)))

@ivankravets this setting had contained tick when I opened the Settings
but I found other problem:

“PATH” is so strange:

“C:\Users\Green Eagle\.platformio\penv\Scripts;C:\Users\Green Eagle\.platformio\penv;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\WINDOWS;C:\Program Files (x86)\Intel\iCLS Client\;Intel\iCLS Client\;C:\ (… some kind of programs) \Programs\Microsoft VS Code\bin”

and VS Code is writing:

This setting cannot be applied now. It will be applied when you open this folder directly.

But I’ll be using Atom instead of VS Code)))
Atom don’t have these problems.))))))
Thank you @ivankravets and @pfeerick for help! ))))


#8

Just disable it http://docs.platformio.org/en/latest/ide/vscode.html#platformio-ide-updateterminalpathconfiguration

VSCode has better integration with PlatformIO than Atom.