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

QtCreator + CMake recognizes only *.hpp and not *.h as include files

    XMLWordPrintable

Details

    • Linux/X11

    Description

      I used QtCreator + CMake to write a small C++ project.

      To my astonishment QtCreator doesn't recognize *.h as C++ files until I change the extension to *.hpp. If I use *.h I get warnings like the following:

       

      In the CMakeFiles.txt I have the following line:

      set(CMAKE_CXX_STANDARD 11)

      but that doesn't help.

       The another strange thing that if I press F4 to switch source/headers QtCreators says: "the ****.h" file not found, until I open it manually and then I can switch from .hpp to .cpp and back.

       

      QtCreator 4.9.0

      Ubuntu Linux 18.04

      CMake 3.10.2

      Attachments

        1. screen.png
          screen.png
          12 kB
        2. testcmake.tar.bz2
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hunger Tobias Hunger
            folibis ruslan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes