Menu

(no subject)

Grit Clef
2025-05-18
2025-05-21
  • Grit Clef

    Grit Clef - 2025-05-18

    (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: Active checkers: There was critical errors (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
  • CHR

    CHR - 2025-05-21

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.