Search code examples
c++qtcmakeg++qt-creator

How do I enable the Compiler warnings(CMake), on qt creator?


So I used to have warnings while I was editing my c++ code in qt creator, but sadly, had to install it again for various problems.. Now while I'm editing the code it doesn't show me any warnings like I used to have,

for example: This is an example off Warnings i used to

But now I only have the warnings when I run the file..

Here is my CMakeLists.txt

cmake_minimum_required(VERSION 3.5)

project(TD06 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# ask for all warnings and strict compliance with the standard
set(CMAKE_CXX_FLAGS "-Wall -pedantic-errors")


add_executable(TD06 main.cpp polynomial.cpp polynomial.h)

I tried to search the problem by searching if someone had the same, or went to look on qt website but didn't find nothing.


Solution

  • This answer might be a little late, but you can turn them back on by going to Edit -> Preferences -> C++ -> Clangd and checking the first checkbox saying "Use clangd".