CLion autocompletion does not work for me. I have initialized the project with platformio init --ide clion -b nodemcu after changing any source code structure. I am on latest PIO dev pio upgrade --dev. I am using the build button for my projects, not the run button. Projects build and upload to my Arduino just fine, but CLion cannot find the include files - files are underlined in red and it says file not found. This causes none of the code completion to work for these include files and the source code is riddled with errors.
Stressing again that actually building and uploading the projects to the Arduino works fine. Then only issue is that CLion cannot find the include files. These files ARE listed in CMakeListsPrivate.txt, such as:
I think the following may be the root of the issue. When CMake runs, this is the output:
C:\Users\qt\.CLion2019.3\system\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=d1 -G "CodeBlocks - Unix Makefiles" /cygdrive/h/projects/arduino/pio-test
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/h/projects/arduino/pio-test/cmake-build-d1
Problems were encountered while collecting compiler information:
Unexpected compiler output. This compiler might be unsupported.
If you are using GCC/Clang, please report the bug in https://youtrack.jetbrains.com/issues/CPP.
[Finished]
It looks like the generation works fine but CLion does not recognize the output? I am not super familiar with CMake so I am not sure. Any help would be greatly appreciated as trying to code without autocomplete kind of negates the purpose of having an IDE.
First and foremost thanks for your reply. I have tried everything I could find for this problem and it is my first PIO’s Project using CLion (It is a bit hard to get CMake especially).
Here is some informations about my configuration :
Cygwin as toolchain? When building with PIO, the xtensa compiler is autodownloaded and does not require any cygwin. Do you have C:\Users\<user>\.platformio\toolchain-xtensa\bin\xtensa-none-elf-gcc set as your compiler in the CMake toolchain settings?
Hum, you right I had the Cygwin compilers configured.
I tried to configure the right compilers because I actually have xtensa compilers and looked how to do it.
While looking to the different documentations I could found, i have seen a difference with CLion. My Toolchains configuration cannot have other environments than those on the screen below :
And if I try to make a Cygwin toolchain with custom compilers & debugger it doesn’t work neither.
PS:
Do you have C:\Users\<user>\.platformio\toolchain-xtensa\bin\xtensa-none-elf-gcc