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. Installed Qt6.8.2 - now cmake cannot find Qt6 components
Forum Updated to NodeBB v4.3 + New Features

Installed Qt6.8.2 - now cmake cannot find Qt6 components

Scheduled Pinned Locked Moved Solved Installation and Deployment
17 Posts 3 Posters 2.7k 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.
  • SGaistS SGaist

    No, you should have stopped at the cmake level.

    Tom assoT Offline
    Tom assoT Offline
    Tom asso
    wrote on last edited by Tom asso
    #7

    @SGaist EDIT: I see, thanks now cmake works!
    CMAKE_PREFIX_PATH=/home/oreilly/Qt6.8/6.8.2/gcc_64/lib/cmake/

    1 Reply Last reply
    0
    • Tom assoT Offline
      Tom assoT Offline
      Tom asso
      wrote on last edited by
      #8

      But now I want to add Graphs component:

      find_package(Qt6 COMPONENTS Gui Quick Graphs REQUIRED)
      

      But cmake fails:

      -- Could NOT find Qt6Graph (missing: Qt6Graph_DIR)
      CMake Error at src/qt-guilib/CMakeLists.txt:25 (find_package):
        Found package configuration file:
      
          /home/oreilly/Qt6.8/6.8.2/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
      
        but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
        FOUND.  Reason given by package:
      
        Failed to find required Qt component "Graph".
      
        Expected Config file at
        "/home/oreilly/Qt6.8/6.8.2/gcc_64/lib/cmake/Qt6Graph/Qt6GraphConfig.cmake"
        does NOT exist
      

      I looked in the online installer, didn't see any "custom" installation for Graphs - How can I install it?

      Thanks!

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

        There's something wrong somewhere. Your components show graphs yet cmake is warning about graph. Did you forget the s in your CMakeLists.txt ?

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

        Tom assoT 1 Reply Last reply
        0
        • SGaistS SGaist

          There's something wrong somewhere. Your components show graphs yet cmake is warning about graph. Did you forget the s in your CMakeLists.txt ?

          Tom assoT Offline
          Tom assoT Offline
          Tom asso
          wrote on last edited by
          #10

          @SGaist
          I tried both "Graph" and "Graphs" - here is output from "Graphs":

          Found package configuration file:
          
             /home/oreilly/Qt6.8/6.8.2/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
          
           but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
           FOUND.  Reason given by package:
          
           Failed to find required Qt component "Graphs".
          
           Expected Config file at
           "/home/oreilly/Qt6.8/6.8.2/gcc_64/lib/cmake/Qt6Graphs/Qt6GraphsConfig.cmake"
           does NOT exist
          
          1 Reply Last reply
          0
          • Tom assoT Offline
            Tom assoT Offline
            Tom asso
            wrote on last edited by Tom asso
            #11

            The problem is that in Qt 6.8.2, the Graphs headers, cmake and libraries components are only found in the Tools/QtDesignStudio directory; e.g. on my system in $HOME/Qt6.8/Tools/QtDesignStudio/qt6_design_studio_reduced_version. But I do not use QtDesignStudio as I've found it to be very buggy in ubuntu 22.04.3.
            It's a pain-in-the-neck but I had to manually create symbolic links in order to build with Qt6 Graphs on my system:

            ln -s ~/Qt6.8/Tools/QtDesignStudio/qt6_design_studio_reduced_version/lib/cmake/Qt6Graphs ~/Qt6.8/6.8.2/gcc_64/lib/Qt6Graphs
            
            ln -s ~/Qt6.8/Tools/QtDesignStudio/qt6_design_studio_reduced_version/lib/libQt6Graphs.so.6.8.0 ~/Qt6.8/6.8.2/gcc_64/lib/libQt6Graphs.so.6.8.0
            
            ln -s ~/Qt6.8/Tools/QtDesignStudio/qt6_design_studio_reduced_version/include/QtGraphs ~/Qt6.8/6.8.2/gcc_64/include/QtGraphs
            

            Perhaps I could avoid making these symbolic links through clever use of environment variables, but the above seems to work now.

            I assume and hope that the Graphs components will be moved from Tools/QtDesignStudio into the "standard" directory (e.g 6.8.x/) in future releases.

            1 Reply Last reply
            0
            • Tom assoT Offline
              Tom assoT Offline
              Tom asso
              wrote on last edited by Tom asso
              #12

              Almost there...
              I add the following to my app's qml file as described here:

              import QtGraphs
              

              I build my app with cmake as described above but when I run it, it generates an error and segfaults:

              module "QtGraphs" is not installed
              Segmentation fault (core dumped)
              

              What am I missing now?
              Thanks!

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

                Did you check that you installed the optional components in the installer ?

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

                Tom assoT 1 Reply Last reply
                0
                • SGaistS SGaist

                  Did you check that you installed the optional components in the installer ?

                  Tom assoT Offline
                  Tom assoT Offline
                  Tom asso
                  wrote on last edited by Tom asso
                  #14

                  @SGaist - I selected "Qt 6.8 for desktop development" in the online installer. As noted above the downloaded components included Qt Graphs code and libraries under the Tools/QtDesignStudio/ directory - I had to make some symbolic links to those in order to build my code (I do not use QtDesignStudio). I can compile and link my application, but "import QtGraphs" fails at runtime. Where are the "optional components" you refer to? If I select "Custom Installation" instead of "Qt 6.8 for desktop development" I don't see options obviously related to Qt Graphs.

                  jsulmJ 1 Reply Last reply
                  0
                  • Tom assoT Tom asso

                    @SGaist - I selected "Qt 6.8 for desktop development" in the online installer. As noted above the downloaded components included Qt Graphs code and libraries under the Tools/QtDesignStudio/ directory - I had to make some symbolic links to those in order to build my code (I do not use QtDesignStudio). I can compile and link my application, but "import QtGraphs" fails at runtime. Where are the "optional components" you refer to? If I select "Custom Installation" instead of "Qt 6.8 for desktop development" I don't see options obviously related to Qt Graphs.

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #15

                    @Tom-asso said in Installed Qt6.8.2 - now cmake cannot find Qt6 components:

                    I had to make some symbolic links to those in order to build my code (I do not use QtDesignStudio)

                    This is wrong Qt modules are not installed in Tools/QtDesignStudio!
                    "Where are the "optional components" you refer to?" - in the Qt installer or Qt maintenance tool.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    Tom assoT 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Tom-asso said in Installed Qt6.8.2 - now cmake cannot find Qt6 components:

                      I had to make some symbolic links to those in order to build my code (I do not use QtDesignStudio)

                      This is wrong Qt modules are not installed in Tools/QtDesignStudio!
                      "Where are the "optional components" you refer to?" - in the Qt installer or Qt maintenance tool.

                      Tom assoT Offline
                      Tom assoT Offline
                      Tom asso
                      wrote on last edited by Tom asso
                      #16

                      OK double-checking that I'm using correct version of the installer...

                      1 Reply Last reply
                      0
                      • Tom assoT Offline
                        Tom assoT Offline
                        Tom asso
                        wrote on last edited by Tom asso
                        #17

                        OK I was using online-installer and MaintenanceTool incorrectly. For my own edification/notes, the "correct" way for Qt desktop seems to be:

                        1. Run installer, specify "Qt" as Qt destination directory, then specify "Qt 6.8 for desktop development"
                        2. Run downloaded Qt/MaintenanceTool , select Add or remove components
                          Qt->Qt6.8.2->Additional libraries->Qt Graphs (plus preselected libraries)

                        Thanks for your help everyone.

                        1 Reply Last reply
                        0
                        • Tom assoT Tom asso has marked this topic as solved on

                        • Login

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