Clion does not show errors anymore

Answered

Hello,

for a few days now CLion does not show me any errors anymore.

  • I am running Ubuntu 20.04.1 LTS
  • I am using the latest version version of CLion - 2020.2
  • My compiler is: g++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0
  • Even if I create a new project with language standard c++20 and run below code, I don't get an error. The code just runs and prints Hello, World!. If I try to compile this code in the terminal however I get the error I expect.

Even right clicking on main.cpp an choosing Inspect code -> File '.../main.cpp' does not work. I have also noticed that, when changing CMAKE_CXX_STANDARD in the CMakeList.txt from 20 to 14, the error is showing for some reason.

set(CMAKE_CXX_STANDARD 14)

How can I fix this?

Sincere regards, Sebastian Wilke

0
1 comment

Hi Sebastian!

>If I try to compile this code in the terminal however I get the error I expect.

You don't build the same CMake project in Terminal, therefore it is incorrect to compare results in CLion and in Terminal. It just means that default standard for you compiler is set to C++14 or lower.

The thing is that in case of C++17 and C++20 it's a valid code, and in case of C++14 - it's not. Please see https://stackoverflow.com/a/46226600, for example.

0

Please sign in to leave a comment.