(Sorry but I don't know where the subject has gone)
Hi, I just added cppcheck to my Qt project based on CMake build system to analyse the codes. I run Cppcheck on a Ubuntu 24.04 system and use a compile_commands.json file as the project file. But when I run cppcheck for the source, I got the following errors:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qsystemdetection.h:134:0:error:#error"Qt has not been ported to this OS - see http://www.qt-project.org/"[preprocessorErrorDirective]#error"Qt has not been ported to this OS - see http://www.qt-project.org/"^nofile:0:0:information:Activecheckers:Therewascriticalerrors(use--checkers-report=<filename> to see details) [checkersReport]
I have added --platform=unix64, but it didn't work.
Is that crucial?
Last edit: Grit Clef 2025-05-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
cppcheck does not need (and should not) process Qt headers. Instead, --library=qt should be used. But I'm not sure how to prevent the issue with a compile-commands.json.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(Sorry but I don't know where the subject has gone)
Hi, I just added cppcheck to my Qt project based on CMake build system to analyse the codes. I run Cppcheck on a Ubuntu 24.04 system and use a compile_commands.json file as the project file. But when I run cppcheck for the source, I got the following errors:
I have added --platform=unix64, but it didn't work.
Is that crucial?
Last edit: Grit Clef 2025-05-18
cppcheck does not need (and should not) process Qt headers. Instead,
--library=qt
should be used. But I'm not sure how to prevent the issue with a compile-commands.json.