can't resolve included libraries

I'm using Clion on Linux (Arch), I've made a CMakeList for my project which compiles and runs without any issues but Clion doesn't seem to resolve any included system library (SDL, OpenGL, Glfw, Bullet Physics..)
It gives many errors on the project.
The same happens with a default "hello world" project, it cannot see <iostream> library.
Any idea aboiuit what coiuld be causing this?
Im really willing to use this IDE as I really liked PyCharm interface, and was looking for a nice interface for c+++,


Could you check please that the Settings | Build, Execution, Deployment | Toolchains Check Environment test doesn't get any issues and problems?
Attach a screen shot please for us to see the toolchain you are using.


thanks for quick reply, here is screenshot for default helloworld project, automatically configured by Clion,
No problems on toolchain, everything green,
Just note that I changed it from default included with Clion to see if it solved problems but was the same with default...

Also don't know if matters, but I installed Clion by unzipping latest EAP in one partition of my disk which is not the same as system is running .. but don't think this could be the origin, as I was doing the same with Eclipse and never had problems,


You are using your custom CMake, that is 3.0.2 version, not supported by the CLion yet.
Please, use bundled version instead, may be this is the source of the problem in your case.


No this isn't the cause, as I mentionned before, I had already this problem with default included version of cmake (in fact I switched to see if it changed anything).
I attached another screenshot which shows the problem still happens with default settings,


I have a similar issue and am using the default cmake.

I've enclosed the screen shots. The fist shows that the "JuceHeader.h" file is greyed out, yet the file is included in Main.cpp and it is listed in the CMakeLists.txt file.

The CMakeList file actually tries to list every file in the project so that it would be treated as part of the project even if it is not included in the Main.cpp include tree.


Does this HEADER_FILES macro is used then in something like:

add_library(lib_name STATIC ${SOURCE_FILES} ${HEADER_FILES})


add_executable(exec_name ${SOURCE_FILES} ${HEADER_FILES})

We have two suggestions for you here:
1. First, it happens because of this issue ( but this is only why the bundled GDB can't be found.
2. Second problem is that you maybe have standard includes not in the place where CMake looks for them. Could you build this Hello world program from the console? And from the CLion?


I have no problem with the building, just the inclusion is not working is the editor and report many errors marked in red.
You can see on the following screenshot when you hover the line including <iostream>  it shows: "canno't find iostream" as well as the red marks on the right..
Also on the console output yoiu see the project build and run fine!
This is possible CMake is not looking at the right emplacement but AFAIK, libs are located in the standard places:

as an example a simple: 'locate iostream' returns:

OTOH Eclipse automatically finds it


Ok, got it. Looks like this is the same as here:

Check the workaround there. Does it help?


My mistake, I did not add the ${HEADER_FILES} to add_executable().

Thanks! Problem solved.


Yep this was exactly the problem I was facing.
using "LANG=en_US.UTF-8" fixed the issue! and now works like a charm :)
Thanks for your help, hope you'll make Clion available at reasonable price because really like the editor so far.

Also FYI, i was having the issue on Arch districution, which is the same as the person who opened the bug on the link you provided.


Hi, I recently had this same problem and just wanted to add for future viewers that if you're on Windows, and a compiler hasn't come bundled with your set-up, you might have had to install one separately. After doing so, you should close and re-open CLion and this might resolve your problem. 


This happens when accessing an include path which is symlinked from another path in the project where the symlinked one is the one used in CMake for example.

In MXNet:


include/nvvm is a symbolic link to 3rdparty/tvm....    when opening the same header via the 3rdparty path, no standard headers are resolved. When opening through include/nvvm which is also the path used in CMake it works as expected.


@Pedro Larroy, thanks for your note! It might be related to and the related issues. Feel free to comment or upvote.


I believe I just found this problem to be caused by a plugin. What I had done just before the standard libraries were found again was I uninstalled a plugin (monkey king) and explicitly set the C++ compiler to g++. At some point after doing both these it started finding the files.