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

Creator does not find 'module includes' on OSX using CMake

XMLWordPrintable

      This issue was raised here: http://qt-project.org/forums/viewthread/36046

      cmake_minimum_required(VERSION 2.8.12)
      
      project(mactest)
      
      find_package(Qt5Core REQUIRED)
      
      add_executable(mactest main.cpp)
      target_link_libraries(mactest Qt5::Core)
      
      #include <QtCore/QObject>
      #include <QString>
      
      int main(int, char**)
      {
        QObject o;
        QString s;
      }
      

      Because the QObject include is prefixed with 'QtCore/', the include is underlined as an error and there is no completion for the 'o' object. The QString include works fine and there is completion for the 's' object.

      My understanding is that unlike on Linux and Windows, on Mac there is no QtCore/QObject file. Instead there is a QObject file in the QtCore framework. The compiler on Mac knows to treat the 'QtCore/QObject' as 'QObject from the QtCore framework', but perhaps creator does not implement that logic or the CMake codeblocks file is not giving sufficient information.

        1. 13137.tar.gz
          1 kB
          Michael Jackson
        For Gerrit Dashboard: QTCREATORBUG-13137
        # Subject Branch Project Status CR V

            dt Daniel Teske
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes