Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Missing QObject build dependency
QtWS25 Last Chance

Missing QObject build dependency

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
9 Posts 4 Posters 1.1k 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.
  • C Offline
    C Offline
    cwible
    wrote on last edited by
    #1

    I've been stuck on this issue for far too long. I am trying to build an application using Qt 5.15.2 and C++ compiler 16.5.29911.84 (x86_amd64). However no matter what I try I seem to get the same error: Dependent '..\..\..\..\..\Qt\5.15.2\msvc2019_64\QtCore\QObject does not exist
    I've tried the following:

    • Checking to see if QObject exists at the specified path (it does)
    • Changing the INCLUDEPATH in my .pro file to include "C:\Qt\5.15.2\msvc2019_64\include\QtCore" which is where QObject lives
    • Confirmed that my header file defines QTObject as: #include <QObject>
    • Verified my .pro file has the QT Flag: QT += core
    • Defined Environment Variable on my Windows machine as QTDir = C:\Qt\5.15.2\msvc2019_64 and added %ATDIR%\bin to my PATH variable
    • Uninstalled and reinstalled Qt

    After each of these changes I clean the project, run qmake and then build the project. However, each time the build fails with the original error.

    Any suggestions of how to fix the problem or narrow down the issue would be greatly appreciated. Thank you

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

      Hi and welcome to devnet,

      Are you using Qt Creator ? Visual Studio ? The command line ?

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

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you using Qt Creator ? Visual Studio ? The command line ?

        C Offline
        C Offline
        cwible
        wrote on last edited by cwible
        #3

        @SGaist Hello, I am using Qt Creator.

        I've narrowed down the problem to an incorrect filepath in the makefiles. If I change the path from ..\..\..\..\..\Qt\5.15.2\* to C:\Qt\5.15.2 the application builds.
        Where do I specify this path in Qt such that it uses the absolute path and not the relative path?

        Thank you

        SGaistS 1 Reply Last reply
        0
        • C cwible

          @SGaist Hello, I am using Qt Creator.

          I've narrowed down the problem to an incorrect filepath in the makefiles. If I change the path from ..\..\..\..\..\Qt\5.15.2\* to C:\Qt\5.15.2 the application builds.
          Where do I specify this path in Qt such that it uses the absolute path and not the relative path?

          Thank you

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You shouldn't need to do that. Can you share your .pro file ?

          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
          • T Offline
            T Offline
            themts
            wrote on last edited by
            #5

            Hi,
            I suddenly have exactly the same problem. Everything was fine before but suddenly I get this error-message on ALL of my projects.

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

              Hi,

              Did anything change such as an update to the toolchain, Windows, anti-virus, etc. ?

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

              T 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Did anything change such as an update to the toolchain, Windows, anti-virus, etc. ?

                T Offline
                T Offline
                themts
                wrote on last edited by themts
                #7

                @SGaist Not that I know.

                By adding "QMAKE_PROJECT_DEPTH = 0" I was able to compile again, but there seems to be something wrong with my QT-installation.

                I just had another problem:
                I created a new, empty "Qt Quick Application" with QT 6.8.0.
                I was not even able to compile as I directly get the error: "Failed to scan target apptestapp for QML imports"
                According to following output, it looks like QT suddenly has a problem with my repository-directory (it has a space in the name" but that was never a problem in the past.

                Anyway, changing the path only fixes the second problem. Without QMAKE_PROJECT_DEPTH = 0 I'm still not able to compile my older projects.

                [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S "C:/Development Repositories/TestProjects/testapp" -B "C:/Development Repositories/TestProjects/testapp/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.8.0/msvc2022_64" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Development Repositories\TestProjects\testapp\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.8.0/msvc2022_64/bin/qmake.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" in C:\Development Repositories\TestProjects\testapp\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug.
                [cmake] -- The CXX compiler identification is MSVC 19.42.34433.0
                [cmake] -- Detecting CXX compiler ABI info
                [cmake] -- Detecting CXX compiler ABI info - done
                [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe - skipped
                [cmake] -- Detecting CXX compile features
                [cmake] -- Detecting CXX compile features - done
                [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
                [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
                [cmake] -- Looking for pthread_create in pthreads
                [cmake] -- Looking for pthread_create in pthreads - not found
                [cmake] -- Looking for pthread_create in pthread
                [cmake] -- Looking for pthread_create in pthread - not found
                [cmake] -- Found Threads: TRUE
                [cmake] -- Performing Test HAVE_STDATOMIC
                [cmake] -- Performing Test HAVE_STDATOMIC - Success
                [cmake] -- Found WrapAtomic: TRUE
                [cmake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
                [cmake] -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
                [cmake] Der Befehl "C:/Development" ist entweder falsch geschrieben oder
                [cmake] konnte nicht gefunden werden.
                [cmake] CMake Error at C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:3859 (message):
                [cmake]   Failed to scan target apptestapp for QML imports: 1
                [cmake] Call Stack (most recent call first):
                [cmake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:3901 (_qt_internal_scan_qml_imports)
                [cmake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:753 (qt6_import_qml_plugins)
                [cmake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:753 (cmake_language)
                [cmake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:851 (_qt_internal_finalize_executable)
                [cmake]   C:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:820:EVAL:1 (qt6_finalize_target)
                [cmake]   CMakeLists.txt:DEFERRED
                [cmake] 
                [cmake] 
                [cmake] -- Configuring incomplete, errors occurred!
                [cmake] 
                [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S "C:/Development Repositories/TestProjects/testapp" -B "C:/Development Repositories/TestProjects/testapp/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.8.0/msvc2022_64" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Development Repositories\TestProjects\testapp\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.8.0/msvc2022_64/bin/qmake.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe"" terminated with exit code 1.
                [cmake] 
                [cmake] Elapsed time: 00:04.
                
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Does 6.8.2 behave in a similar fashion ?

                  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
                  • aha_1980A Offline
                    aha_1980A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    I hat such errors appearing suddenly also, and what helped was to put the build directory next to the source directory, not below the source dir as QtCreator does nowadays.

                    For me, that was with make projects and Qt 5.15.

                    Regards

                    Qt has to stay free or it will die.

                    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