My setup:
Windows 10 Pro 22H2 (19045.2965)
CLion 2020.1.3 (JetBrains)
WSL2 with Ubuntu 22.04.2 LTS
gcc 11.3.0
cmake 3.22.1
gdb 12.1
gmake 4.3
CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(HelloWorld)
set(CMAKE_CXX_STANDARD 14)
add_executable(HelloWorld main.cpp)
main.cpp
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
In the above, <iostream>
is flagged as " iostream file not found." CLion is unable to find any system headers. Whether it by the C++ standard headers or any add-on libraries, such as wxWidgets. As a result, it has difficulty seeing any of the classes, namespaces, etc., found in the headers. It has no problems seeing local project headers.
The project compiles.
I have tried adding
include_directories(
SYSTEM
includes
/usr/include
)
to the CMakeLists.txt
file. I have also tried reinstalling CLion.
I know there is a newer version of CLion available, upgrading is currently off the table.
How do I get CLion to behave?