Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. QWidget can't be found in file included by INCLUDEPATH in pro file
Qt 6.11 is out! See what's new in the release blog

QWidget can't be found in file included by INCLUDEPATH in pro file

Scheduled Pinned Locked Moved C++ Gurus
10 Posts 2 Posters 5.3k 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.
  • A Offline
    A Offline
    aidush
    wrote on last edited by
    #1

    When I build project I end up with such error:
    @/Developer/usr/bin/g++ -c -pipe -O2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -Wall -W -fPIC -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DDTT_DLL -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Qt-5.3.2/mkspecs/macx-g++ -I. -Iinclude -I../thirdparty/log4qt -Isrc1 -I/usr/local/Qt-5.3.2/lib/QtWidgets.framework/Versions/5/Headers -I/usr/local/Qt-5.3.2/lib/QtXml.framework/Versions/5/Headers -I/usr/local/Qt-5.3.2/lib/QtNetwork.framework/Versions/5/Headers -I/usr/local/Qt-5.3.2/lib/QtGui.framework/Versions/5/Headers -I/usr/local/Qt-5.3.2/lib/QtCore.framework/Versions/5/Headers -Irelease -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AGL.framework/Headers -Irelease -F/usr/local/Qt-5.3.2/lib -o release/ApiNetworkAccessManager.o src/core/apiclient/ApiNetworkAccessManager.cpp
    /Developer/usr/bin/g++ -pipe -O2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -Wall -W -fPIC -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DDTT_DLL -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB src1/qtvariantproperty.cpp -o src1/qtvariantproperty
    In file included from src1/qtvariantproperty.h:45,
    from src1/qtvariantproperty.cpp:42:
    src1/qtpropertybrowser.h:45:29: error: QtWidgets/QWidget: No such file or directory@

    where ApiNetworkAccessManager is file contained by project and qtpropertybrowser as well as qtvariantproperty were included by INCLUDEDPATH in pro file. What is strange is that frameworks are only used in building of ApiNetworkAccessManager but not for qtvariantproperty.

    does anybody knows where could be a problem?

    my pro file:
    @TEMPLATE = lib
    TARGET = imsCommon
    DESTDIR = ../lib
    QT += network xml widgets
    CONFIG += debug_and_release x86 x86_64
    DEFINES += QT_XML_LIB QT_NETWORK_LIB QT_SCRIPT_LIB DTT_DLL
    INCLUDEPATH += ./include
    ./../thirdparty/log4qt
    ./src1
    LIBS += -L"./../lib"

    CONFIG(debug, debug|release) {
    UI_DIR = debug
    TARGET = $$join(TARGET,,,d)
    LIBS += -llog4Qtd
    -lQtSolutions_PropertyBrowser-2.5d
    }
    else {
    UI_DIR = release
    LIBS += -llog4Qt
    -lQtSolutions_PropertyBrowser-2.5
    }

    #Include file(s)
    include(imsCommon.pri)

    #Windows resource file
    win32:RC_FILE = imsCommon.rc

    macx{
    QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../Frameworks/
    LIBS += -framework QuickTime -framework Carbon
    }@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      What if in src1/qtpropertybrowser.h instead of
      @
      #include "QtWidgets/QWidget"
      @

      you will use
      @
      #include "QWidget"
      @

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aidush
        wrote on last edited by
        #3

        Same error. Here is problem that frameworks are missing during complilation of qtvariantproperty. If I include <QtWidgets/QWidget> in ApiNetworkAccessManager.h everything is ok

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          Compile command line for qtvariantproperty.cpp looks different than for ApiNetworkAccessManager.cpp. It does not include any -I options.
          And I don't see any SOURCES, HEADERS keywords in your .pro file.

          How so you include the sources and the headers in the project?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aidush
            wrote on last edited by
            #5

            They are listed in imsCommon.pri file.

            If I examine makefile.release I have there :

            @release/moc_InfoFieldEditorFactory.cpp: src1/qtvariantproperty.h
            src1/qtpropertybrowser.h
            /usr/local/Qt-5.3.2/lib/QtCore.framework/Versions/5/Headers/QHash
            /usr/local/Qt-5.3.2/lib/QtCore.framework/Versions/5/Headers/qhash.h
            /usr/local/Qt-5.3.2/lib/QtWidgets.framework/Versions/5/Headers/QTreeWidgetItem
            /usr/local/Qt-5.3.2/lib/QtWidgets.framework/Versions/5/Headers/qtreewidget.h
            include/gui/InfoFieldEditorFactory.h
            /usr/local/Qt-5.3.2/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -I/usr/local/Qt-5.3.2/mkspecs/macx-g++ -I/Users/pka/DesktopTools/TeamEdition_Qt5/imsCommon -I/Users/pka/DesktopTools/TeamEdition_Qt5/imsCommon/include -I/Users/pka/DesktopTools/TeamEdition_Qt5/thirdparty/log4qt -I/Users/pka/DesktopTools/TeamEdition_Qt5/imsCommon/src1 -I/usr/local/Qt-5.3.2/lib/QtWidgets.framework/Headers -I/usr/local/Qt-5.3.2/lib/QtXml.framework/Headers -I/usr/local/Qt-5.3.2/lib/QtNetwork.framework/Headers -I/usr/local/Qt-5.3.2/lib/QtGui.framework/Headers -I/usr/local/Qt-5.3.2/lib/QtCore.framework/Headers -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64 -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/backward -I/Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc/i686-apple-darwin10/4.2.1/include -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -F/usr/local/Qt-5.3.2/lib include/gui/InfoFieldEditorFactory.h -o release/moc_InfoFieldEditorFactory.cpp@

            If I understood it right.. also comparing with other compilation commands.. after each file, there should be list of used qt headers but this list misses for qtvariantproperty and qtpropertybrowser. It seems like there were not analyzed at all. QHash and QTreeWidgetItem are headers defined in InfoFieldEditorFactory.h

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              src1/qtvariantproperty.cpp is listed under SOURCES and src1/qtvariantproperty.h is listed under HEADERS in imsCommon.pri. Is it right?

              Did you try to re-run qmake after you added src1/qtvariantproperty.cpp ?

              What if you create simple widget project and add qtvariantproperty.cpp, .h and try to build it ?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aidush
                wrote on last edited by
                #7

                No qtvariantproperty.cpp/h are included with INCLUDEPATH as you can see it in pro file.

                I build project from command line where everytime qmake is called. So yes I did.

                I can try it with simple project. Tomorrow. But for now it seems to me like qmake treats different project files and files included via INCLUDEPATH keyword

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andreyc
                  wrote on last edited by
                  #8

                  qmake uses SOURCES to create correct command line to compile the sources.
                  Try to add qtvariantproperty.cpp to SOURCES in your .pro file

                  @
                  SOURCES += src1/qtvariantproperty.cpp
                  @

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    aidush
                    wrote on last edited by
                    #9

                    The thing is that qtvariantproperty and qtpropertybrowser are already built in library QtSolutions_PropertyBrowser-2.5. I want to include just header files, so I can use functionality implemented in that dll as it woult be in ImsCommon library. I don't want to build them in this project again..

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      aidush
                      wrote on last edited by
                      #10

                      problem disappeared after downloading fresh project from repository

                      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