Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Annotation always say that the header file not found
Forum Updated to NodeBB v4.3 + New Features

Annotation always say that the header file not found

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 2 Posters 434 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hwl88618
    wrote on last edited by
    #1

    Environment: win10 x64 ltsc 2021 + visual studio 2017 + qt 5.12.12
    I put SDL libs in C drive, and correctly set the environment variables in qt kits, such as INCLUDE, LIB and PATH.
    Now, compiling and running are all fine, but the qtcreator always say that the header file not found, and lots of unknown type name. I've tried to disable ClangCodeModel and enable it again, but it did not work.
    alt text
    alt text
    alt text
    alt text

    1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from Installation and Deployment on
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      It should be INCLUDEPATH and must be added into the pro-file: https://doc.qt.io/qt-6/qmake-variable-reference.html#includepath
      Same goes for LIBS: https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      H 1 Reply Last reply
      1
      • H Offline
        H Offline
        hwl88618
        wrote on last edited by
        #3

        Solved by myself.
        What I want is like this, I don't need to add INCLUDEPATH in pro file, nor the LIB, the PATH, only the library name, just like this:
        alt text
        alt text
        There are 4 environment variables related:
        INCLUDE/INCLUDEPATH: these 2 variables are all needed. At first I only set INCLUDE but the INCLUDEPATH was lost, so that compiling and running are fine but the annotation can not find the header file.
        LIB: static library path, needed when compiling.
        PATH: dynamic library path, needed when running.
        Ways to set environment variables in qtcreator:
        Tools, options, environment, system, environment. Here we can set the environment variables used by all kits.
        alt text
        Tools, options, kits, select one kit, environment. Here we cat set the environment variables used exactly by one kit.
        alt text

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          It should be INCLUDEPATH and must be added into the pro-file: https://doc.qt.io/qt-6/qmake-variable-reference.html#includepath
          Same goes for LIBS: https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

          H Offline
          H Offline
          hwl88618
          wrote on last edited by
          #4

          @Christian-Ehrlicher thx, but not what I wanted. I've solved this myslef.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            The env vars are not needed at all when you properly configure the include path on the pro file...

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved