Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Including a QT header into a souce file that is outside of the project tree causes compiler errors.
Forum Updated to NodeBB v4.3 + New Features

Including a QT header into a souce file that is outside of the project tree causes compiler errors.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by Dmitriano
    #1

    If I add

    #include <QOpenGLTexture>
    

    into my QML project I got errors of type '<something1> must be included before any header file that defines <something1>', for example:

    libs/qt591/include/QtCore/qtextstream.h:52: error: #error qtextstream.h must be included before any header file that defines Status
    #error qtextstream.h must be included before any header file that defines Status
    ^~~~~

    This something2 can be Status, Bool or something else, depending on where I include <QOpenGLTexture>. Tried to make <QOpenGLTexture> the first include file in my sources, but with no success.

    I use QT 5.9.1.

    This happens if I include any qt header like <QDebug> for example into a header that is outside of the project tree.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show your project tree ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you show your project tree ?

        D Offline
        D Offline
        Dmitriano
        wrote on last edited by
        #3

        @SGaist in the PRO file I have this:

        QT += qml quick multimedia

        CONFIG += c++11

        VERSION = 1.0.14
        #Enable OpenGL function definitions in the GL headers
        DEFINES += GL_GLEXT_PROTOTYPES VERSION_STRING=\"$$VERSION\"

        INCLUDEPATH += ../MyApp/MyApp.Shared ../../../lib/Awl

        SOURCES += main.cpp
        Util/QtAssetStorage.cpp
        Util/QtAssetStream.cpp
        Util/QtFileSystem.cpp
        Util/QtPlatformCapabilities.cpp
        Util/QtSysUtil.cpp
        ../MyApp/MyApp.Shared/Animation/Animation.cpp
        ../MyApp/MyApp..Shared/Animation/RotationAnimation.cpp
        ../MyApp/MyApp.Shared/Geometries/ArrowGeometry.cpp
        ....

        if I include a QT header in a file in a ../MyApp/MyApp.Shared/ subfolder I get this.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Is this some kind of library you are using ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply
          0
          • SGaistS SGaist

            Is this some kind of library you are using ?

            D Offline
            D Offline
            Dmitriano
            wrote on last edited by
            #5

            @SGaist it is not a library, but it is a shared sources that I use with my QT project and a UWP project that I compile with MSVS 2015.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              And that "shared sources" also uses Qt ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

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