Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25816

Code Model doesn't take INCLUDE variable into account

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.15.0
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      Windows 10 21H1
      MSVC2019 64 bit
    • Platform/s:
      Windows

      Description

      1. Create a new project.
        I used a CMake-based Qt Console Application.
      2. In main.cpp, include a non-existent header file, e.g.:
        #include <myfictitiousheader.h>
        

        Very soon the clang code model will complain that it can't find this file. Of course, the file doesn't exist. Building will fail, too.

      3. Create a file of that name somewhere on your machine.
        Clang and the compiler still complain about this file. Of course, they cannot find it.
      4. In Projects mode, Build settings, edit the build environment. Add the directory where you created the header file to the environment variable "INCLUDE".
      5. Build the project.
        The project can be built successfully, but the clang code model still complains.

      If the compiler is able to find the file, clang should be, too.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes