GammaRay icon indicating copy to clipboard operation
GammaRay copied to clipboard

CMake error: Imported target "Qt::X" includes non-existent path

Open SkylerA opened this issue 3 years ago • 4 comments

Hello,

I'm trying to build GammaRay in ubuntu 20.04 (in WSL2) and early in the cmake process after cd build and executing cmake .. I get a cascade of errors with this format:

CMake Error in common/CMakeLists.txt:
  Imported target "Qt::GuiPrivate" includes non-existent path

    "/usr/include/x86_64-linux-gnu/qt5/QtGui/5.12.8"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

This occurs for probably 30+ qt modules.

The error is correct that /usr/include/x86_64-linux-gnu/qt5/QtGui/5.12.8 does not exist, /usr/include/x86_64-linux-gnu/qt5/ exists, but none of the folders seem to contain the version number in their path.

I believe my build is natively pointing to the following, and i tried to explicitly build w/ -DCMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu/cmake/Qt5, but got the same result

ls /usr/lib/x86_64-linux-gnu/cmake/Qt5/

Qt5Config.cmake  Qt5ConfigVersion.cmake  Qt5ModuleLocation.cmake

Below is the output from cmake .. minus the many duplicate non-existent path errors:

cmake .. -- The CXX compiler identification is GNU 9.4.0 -- The C compiler identification is GNU 9.4.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) -- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) -- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR) -- Found Backward: /home/skyler/code/GammaRay/3rdparty/backward-cpp -- Found Git: /usr/bin/git (found version "2.25.1") -- Building GammaRay 2.99.50 (revision: a61dde067) in Release mode -- Performing Test C_SUPPORTS_UNUSED_BUT_SET -- Performing Test C_SUPPORTS_UNUSED_BUT_SET - Success -- Performing Test CXX_SUPPORTS_UNUSED_BUT_SET -- Performing Test CXX_SUPPORTS_UNUSED_BUT_SET - Success -- Performing Test C_SUPPORTS_LOGICAL_OP -- Performing Test C_SUPPORTS_LOGICAL_OP - Success -- Performing Test CXX_SUPPORTS_LOGICAL_OP -- Performing Test CXX_SUPPORTS_LOGICAL_OP - Success -- Performing Test C_SUPPORTS_POINTER_MEMACCESS -- Performing Test C_SUPPORTS_POINTER_MEMACCESS - Success -- Performing Test CXX_SUPPORTS_POINTER_MEMACCESS -- Performing Test CXX_SUPPORTS_POINTER_MEMACCESS - Success -- Performing Test C_SUPPORTS_REORDER -- Performing Test C_SUPPORTS_REORDER - Failed -- Performing Test CXX_SUPPORTS_REORDER -- Performing Test CXX_SUPPORTS_REORDER - Success -- Performing Test C_SUPPORTS_FORMAT_SECURITY -- Performing Test C_SUPPORTS_FORMAT_SECURITY - Success -- Performing Test CXX_SUPPORTS_FORMAT_SECURITY -- Performing Test CXX_SUPPORTS_FORMAT_SECURITY - Success -- Performing Test C_SUPPORTS_SUGGEST_OVERRIDE -- Performing Test C_SUPPORTS_SUGGEST_OVERRIDE - Failed -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE -- Performing Test CXX_SUPPORTS_SUGGEST_OVERRIDE - Success -- Performing Test HAVE_GXX_GNUXX11 -- Performing Test HAVE_GXX_GNUXX11 - Success -- Performing Test HAVE_GXX_CXX11 -- Performing Test HAVE_GXX_CXX11 - Success -- Performing Test C_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT -- Performing Test C_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT - Failed -- Performing Test CXX_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT -- Performing Test CXX_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT - Success -- Not building GammaRay Widget 3D -- Looking for QT_NO_OPENGL -- Looking for QT_NO_OPENGL - not found -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for backtrace -- Looking for backtrace - found -- Looking for abi::__cxa_demangle -- Looking for abi::__cxa_demangle - found -- Building probe for ABI: qt5_12-x86_64 (Release) -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Performing Test HAVE_NO_CXX_ZERO_AS_NULL_POINTER_CON -- Performing Test HAVE_NO_CXX_ZERO_AS_NULL_POINTER_CON - Success -- Performing Test HAVE_NO_CXX_UNNEEDED_INTERNAL_DEC -- Performing Test HAVE_NO_CXX_UNNEEDED_INTERNAL_DEC - Success -- Performing Test HAVE_NO_CXX_NULL_CONVERSION -- Performing Test HAVE_NO_CXX_NULL_CONVERSION - Success -- Could NOT find Wayland_Server (missing: Wayland_Server_LIBRARY Wayland_Server_INCLUDE_DIR) (found version "") -- Could NOT find Wayland (missing: Wayland_LIBRARIES Server) (Required is at least version "1.12") Package wayland-server was not found in the pkg-config search path. Perhaps you should add the directory containing `wayland-server.pc' to the PKG_CONFIG_PATH environment variable No package 'wayland-server' found CMake Warning at cmake/ECM/find-modules/FindWayland.cmake:130 (message): Could not find wayland.xml in Call Stack (most recent call first): plugins/wlcompositorinspector/CMakeLists.txt:3 (find_package)

-- Unable to build user manual in qch format. -- qdoc executable: /usr/bin/qdoc -- qhelpgenerator executable: /usr/bin/qhelpgenerator -- qtattributionsscanner executable: /usr/bin/qtattributionsscanner -- qdoc template (qt-html-templates-offline.qdocconf): /usr/share/qt5/doc/global/qt-html-templates-offline.qdocconf -- qdoc qtcore index (qtcore.index): QDOC_QTCORE_INDEX-NOTFOUND -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- The following features have been enabled:

  • Option GAMMARAY_BUILD_UI, Build the GammaRay client and in-process UI.
  • Option GAMMARAY_MULTI_BUILD, Build multiple applicable probe configurations.
  • Option GAMMARAY_BUILD_CLI_INJECTOR, Build command line injector on Windows.
  • Option GAMMARAY_BUILD_DOCS, Build GammaRay documentation.
  • ELF ABI detection, Automatic probe ABI detection on ELF-based systems. Requires elf.h.

-- The following OPTIONAL packages have been found:

  • Git Determine exact build version.
  • Qt5OpenGL
  • Qt5Qml
  • Qt5Quick
  • Qt5QuickWidgets
  • Qt5Test
  • Qt5Scxml (required version >= 5.8)
  • QmlLint, https://qt.io Validate QML code.
  • PkgConfig

-- The following RECOMMENDED packages have been found:

  • Qt5Concurrent Required for the GammaRay launcher process list.
  • pod2man, Man page generator Generate GammaRay man pages.

-- The following REQUIRED packages have been found:

  • Qt (required version >= 5.5)
  • Qt5Core (required version >= 5.12.8)
  • Qt5Gui
  • Qt5Network
  • Qt5Widgets
  • Qt5, https://qt.io/

-- The following features have been disabled:

  • Option GAMMARAY_PROBE_ONLY_BUILD, Build only an additional probe configuration for an already existing launcher.
  • Option GAMMARAY_CLIENT_ONLY_BUILD, Build the client part only.
  • Option GAMMARAY_ENABLE_GPL_ONLY_FEATURES, Enable features only available under GPL license.
  • Option GAMMARAY_INSTALL_QT_LAYOUT, Install into Qt directory layout.
  • Option GAMMARAY_STATIC_PROBE, Build the probe as static library for compile-time injection.
  • Option GAMMARAY_ENFORCE_QT_ASSERTS, Force QT_ASSERT in all builds.
  • Option GAMMARAY_DISABLE_FEEDBACK, Disable user feedback support.
  • Option GAMMARAY_USE_PCH, Enable Precompiled Headers support
  • Option ENABLE_GOLD_LINKER, Use GNU gold linker
  • Option GAMMARAY_QT6_BUILD, Build with Qt6.
  • Option GAMMARAY_CORE_ONLY_LAUNCHER, Only use QtCore in the CLI launcher (breaks style injector, but is needed for Boot2Qt compatibility)
  • QtScript debugger, Requires QtScript and QtScriptTools.
  • Widget .ui file export, Requires QtDesigner library.
  • 3D Widget Inspector, Requires Qt5 >= 5.7, Qt3D and QtQuick Controls
  • User Manual creation in qch format, Requires qdoc, qhelpgenerator, qtattributionsscanner, the qdoc templates and index files

-- The following OPTIONAL packages have not been found:

  • Qt53DAnimation
  • Qt53DExtras
  • Qt53DInput
  • Qt53DLogic
  • Qt53DRender
  • Qt53DQuick
  • Qt5AndroidExtras
  • Qt5Bluetooth
  • Qt5Designer
  • Qt5Location
  • Qt5Positioning
  • Qt5Svg Required for widget SVG export.
  • Qt5Script
  • Qt5ScriptTools
  • Qt5WebEngineWidgets
  • Qt5WaylandCompositor
  • Qt5IviCore (required version >= 1.1)
  • Qt5IviVehicleFunctions (required version >= 1.1)
  • Qt5IviMedia (required version >= 1.1)
  • Qt5Help
  • Qt5LinguistTools
  • Glslang, https://github.com/KhronosGroup/glslang Validate GL shader code.
  • KF5CoreAddons, KDE KCoreAddons Framework, https://www.kde.org/ Required for the KJob tracker plug-in.
  • VTK, Visualization Toolkit, https://www.vtk.org Needed for the object visualizer plugin (required Qt5). Just for toying around, highly experimental plugin.
  • Wayland (required version >= 1.12), C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients, https://wayland.freedesktop.org/ Needed for the QtWayland compositor inspector plug-in.
  • Doxygen, API Documentation system, https://www.doxygen.org Needed to build the API documentation.

-- The following RECOMMENDED packages have not been found:

-- Configuring done

Any tips on how i might go about debugging how/why my system is erroneously adding the 5.12.8 to the path?

I'm not too experienced with cmake so i don't know how to debug this, but i'm happy to try any debug commands or provide any additional info.

Any advice is appreciated, Thanks!

SkylerA avatar Jul 01 '22 18:07 SkylerA

Hello, could you please remind me when you have found a solution. Thanks in advance!

tim-gromeyer avatar Aug 22 '22 21:08 tim-gromeyer

I found a solution myself. You just need to install this package: qtbase5-private-dev and if you use Qml or Quick you also need to install this package: qtdeclarative5-private-dev

tim-gromeyer avatar Aug 23 '22 16:08 tim-gromeyer

we had CMake code that checked for missing private headers for Qt. perhaps that broke or got lost during that Qt6 port.

yes, GammaRay definitely requires Qt private dev packages.

this is a bug we need to fix

winterz avatar Aug 23 '22 20:08 winterz

For now, a note in the README would be very helpful, as with KDDockWidgets (which is where I got the idea to install these packages)

tim-gromeyer avatar Aug 23 '22 21:08 tim-gromeyer

added info about Qt private headers in commit c33c91d57028dfbec1725cf786c07d34d1c98a75

We decided not to attempt to restore the CMake code that alerts about missing private headers as it adds a lot of complexity for handling an incomplete Qt installation.

winterz avatar Nov 07 '22 15:11 winterz