CLion not detecting header files


I’m trying to create a project for Arduino in CLion with PlatformIO.
I tried different ways for this.
First I created a PlatformIO project using the plugin for CLion which created the whole achitecture and a main.cpp file with “#include <Arduino.h>” at the first line. The problem is that CLion does not find the Arduino.h, nor other standard header file (like iostream).
The thing is that if I try to upload the project, it works. The problem is only in the IDE.

As it was a fresh install of CLion I wondered if it came from my configuration, so I created another standard C++ project, a simple Hello World, with iostream included. Everything worked perfectly so it didn’t come from the IDE.
Then I initialized PlatformIO in this project, using PlatofrmIO Home, and suddenly CLion could not find iostream or any other header anymore.

So the problem seems to come from the config done by PIO.

Also, I tried to add include_directories directive in the CMakeLists.txt file, and I noticed that when I refresh CMake then I have the following error:
Problems were encountered while collecting compiler information:
Unexpected compiler output. This compiler might be unsupported.

So it might be the reason of the problem, but since I successfully compiled a simple hello world I don’t understand the error.

iostream? On a microcontroller?

Sounds like the same type of error as described and solved in Arduino.h not found - #7 by maxgerhardt to me.