CLion autocompletion not working


#1

Is autocompletion supposed to work in clion? Because I can’t get it.

I did:

  • platformio init --ide clion -b nodemcu
  • opened project
  • added src/main.cpp and included <Arduino.h>
  • added setup() and loop()
  • built

The problem is that Arduino.h is red-underlined and marked as as not found and autocompletion doesn’t seem to work at all.

When cmake project reloads i get the following errors:

C:\Users\Edo\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\182.4892.24\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G “CodeBlocks - NMake Makefiles” C:\Users\Edo\Desktop\Temporanea\test
– Configuring done
– Generating done
– Build files have been written to: C:/Users/Edo/Desktop/Temporanea/test/cmake-build-debug

Cannot get compiler information:
Compiler exited with error code 1: C:\Users\Edo.platformio\packages\toolchain-xtensa\bin\xtensa-lx106-elf-g++.exe @C:\Users\Edo\AppData\Local\Temp\response-file C:\Users\Edo\AppData\Local\Temp\compiler-file | @response-file=/TP -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\tools\sdk\include -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\tools\sdk\libc\xtensa-lx106-elf\include -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\cores\esp8266 -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\variants\nodemcu -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ArduinoOTA -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\DNSServer\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\EEPROM -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266AVRISP\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPUpdateServer\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266LLMNR -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266NetBIOS -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266SSDP -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WebServer\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFiMesh\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266httpUpdate\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266mDNS -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\Ethernet\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\GDBStub\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\Hash\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\SD\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\SPI -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\SPISlave\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\Servo\src -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\SoftwareSerial -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\TFT_Touch_Shield_V2 -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\Ticker -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\Wire -IC:\Users\Edo.platformio\packages\framework-arduinoespressif8266\libraries\esp8266\src -IC:\Users\Edo.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include -IC:\Users\Edo.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2 -IC:\Users\Edo.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\xtensa-lx106-elf -IC:\Users\Edo.platformio\packages\toolchain-xtensa\lib\gcc\xtensa-lx106-elf\4.8.2\include -IC:\Users\Edo.platformio\packages\toolchain-xtensa\lib\gcc\xtensa-lx106-elf\4.8.2\include-fixed -IC:\Users\Edo.platformio\packages\tool-unity -IC:\Users\Edo\Desktop\Temporanea\test\include -IC:\Users\Edo\Desktop\Temporanea\test\src /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 “-D’PLATFORMIO=30602’” “-D’ESP8266’” “-D’ARDUINO_ARCH_ESP8266’” “-D’ARDUINO_ESP8266_NODEMCU’” “-D’F_CPU=80000000L’” “-D’ets’” “-D’ICACHE_FLASH’” “-D’ARDUINO=10805’” “-D’ARDUINO_BOARD=PLATFORMIO_NODEMCUV2’” “-D’LWIP_OPEN_SRC’” “-D’VTABLES_IN_FLASH’” /Be /Bd /EP
xtensa-lx106-elf-g++.exe: error: /TP: No such file or directory
xtensa-lx106-elf-g++.exe: error: /DWIN32: No such file or directory
xtensa-lx106-elf-g++.exe: error: /D_WINDOWS: No such file or directory
xtensa-lx106-elf-g++.exe: error: /W3: No such file or directory
xtensa-lx106-elf-g++.exe: error: /GR: No such file or directory
xtensa-lx106-elf-g++.exe: error: /EHsc: No such file or directory
xtensa-lx106-elf-g++.exe: error: /MDd: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Zi: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Ob0: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Od: No such file or directory
xtensa-lx106-elf-g++.exe: error: /RTC1: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Be: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Bd: No such file or directory
xtensa-lx106-elf-g++.exe: error: /EP: No such file or directory

[Failed to reload]

CMakeLists.txt is default, I did not touch anything, I can see add_executable(${PROJECT_NAME} ${SRC_LIST}) present.

Using the build button it builds just fine.


#2

Please re-init your project after file structure changes.


#3

Sorry, still no luck even after re-initializing the project after the src file is added. Always the same error:

Compiler exited with error code 1: C:\Users\Edo.platformio\packages\toolchain-xtensa\bin\xtensa-lx106-elf-g++.exe […] /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 “-D’PLATFORMIO=30602’” “-D’ESP8266’” “-D’ARDUINO_ARCH_ESP8266’” “-D’ARDUINO_ESP8266_NODEMCU’” “-D’F_CPU=80000000L’” “-D’ets’” “-D’ICACHE_FLASH’” “-D’ARDUINO=10805’” “-D’ARDUINO_BOARD=PLATFORMIO_NODEMCU’” “-D’LWIP_OPEN_SRC’” “-D’VTABLES_IN_FLASH’” /Be /Bd /EP
xtensa-lx106-elf-g++.exe: error: /TP: No such file or directory
xtensa-lx106-elf-g++.exe: error: /DWIN32: No such file or directory
xtensa-lx106-elf-g++.exe: error: /D_WINDOWS: No such file or directory
xtensa-lx106-elf-g++.exe: error: /W3: No such file or directory
xtensa-lx106-elf-g++.exe: error: /GR: No such file or directory
xtensa-lx106-elf-g++.exe: error: /EHsc: No such file or directory
xtensa-lx106-elf-g++.exe: error: /MDd: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Zi: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Ob0: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Od: No such file or directory
xtensa-lx106-elf-g++.exe: error: /RTC1: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Be: No such file or directory
xtensa-lx106-elf-g++.exe: error: /Bd: No such file or directory
xtensa-lx106-elf-g++.exe: error: /EP: No such file or directory