I’m using a clean install of MacOS Catalina (long story) and I’ve done a clean install of Homebrew and CLion. I installed PlatformIO using Homebrew, then I installed the PlatformIO Plugin into CLion.
I create a new project, then I always modify my Platformio.ini file to include some folders where the libraries I need are located.
However, when I create a new project, the Arduino.h library isn’t included in the project (no code completion etc.). And when I try to add the folder to Platformio.ini, it won’t pick it up. HOWEVER, if I include Arduino.h by typing out the full path to the library, it works just fine, with code completion etc.
So obviously, my lib_extra_dirs in Platformio.ini isn’t informing the project that those folders are searchable locations for library #include statements…
And YES, I did use Tools, PlatformIO, Re-Init after making the change to Platformio.ini
Arduino in this sense is not a library but the framework, or core. No lib_extra_dirs directives must be used to include the Arduino core, that is already done by framework = arduino. You should remove the last two entries of lib_extra_dirs and the first one as well, in favor for lib_deps.
Unreproducable. Creating a new project with the PlatformIO CLion plugin installed, using New → Project → PlatformIO,
The reason I looked here, was because when I tried to build a project, it kept saying: Error: Unknown environment names 'Debug'. Valid names are 'nanoatmega328new'
So under CMake, I created a profile that matched the name of the section in Platformio.ini
[nanoatmega328new]
and then I was able to build a project … then I thought, “I wonder if the inclusion works now” and when I took away the path to an included library, sure enough, it picked it up just fine.
I appreciate the detail in your response. You did teach me some things that I didn’t previously know about PlatformIO and that is definitely appreciated! So thank you for taking the time to write this reply.
Just for completeness: The documentation mentions that. You can just remove all CMake profiles / environments and press the “+” button and it will fill it with the correct details. This also works for multiple environment entries in the platformio.ini