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. Installing Qt Sql (qt verion 5)
Forum Updated to NodeBB v4.3 + New Features

Installing Qt Sql (qt verion 5)

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 1.1k Views 2 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.
  • R Offline
    R Offline
    ReneUafasah
    wrote on 15 Jun 2022, 15:42 last edited by
    #1

    Hello Forum,

    I was expecting to see an option to "click and install" in order to get the QtSql package in the Maintenance Tool.
    It didnt appear. I am using Qt 5.15.2. When I click on "Add and Remove Components" it didnt appear among the other list of "goodies" like QtWebEngine etc.

    Am I looking in the wrong place? Where do I find it?

    Rene

    C 1 Reply Last reply 15 Jun 2022, 15:46
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Jun 2022, 09:23 last edited by
      #10

      Then again, as @Christian-Ehrlicher, the issue is how you link them to your application and that is what you should show.

      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
      • R ReneUafasah
        15 Jun 2022, 15:42

        Hello Forum,

        I was expecting to see an option to "click and install" in order to get the QtSql package in the Maintenance Tool.
        It didnt appear. I am using Qt 5.15.2. When I click on "Add and Remove Components" it didnt appear among the other list of "goodies" like QtWebEngine etc.

        Am I looking in the wrong place? Where do I find it?

        Rene

        C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 15 Jun 2022, 15:46 last edited by
        #2

        @ReneUafasah said in Installing Qt Sql (qt verion 5):

        Where do I find it?

        It's already installed with the base Qt installation.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ReneUafasah
          wrote on 15 Jun 2022, 15:58 last edited by
          #3

          Thanks for that info.

          I am getting this error in my application:

          C1083: Cannot open include file: 'QtSql': No such file or directory

          For what its worth, I have this in my CMakeLists.txt:

          set(linked_libraries
          PUBLIC Qt5::Core
          PUBLIC Qt5::Sql.....

          Qt5::Core works "out of the box" as you would expect but Qt5::Sql is somehow not found.

          C 1 Reply Last reply 15 Jun 2022, 17:47
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 15 Jun 2022, 17:36 last edited by
            #4

            Hi,

            If you are on Linux, are you sure you are using the Qt version from the online installer and the one from your distribution ?

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

            R 1 Reply Last reply 15 Jun 2022, 20:16
            1
            • M Offline
              M Offline
              mchinand
              wrote on 15 Jun 2022, 17:46 last edited by
              #5

              Do you have a line like this (or combined with other Qt modules) in your CMakelLists.txt file:

              find_package(Qt5Sql REQUIRED)
              
              1 Reply Last reply
              1
              • R ReneUafasah
                15 Jun 2022, 15:58

                Thanks for that info.

                I am getting this error in my application:

                C1083: Cannot open include file: 'QtSql': No such file or directory

                For what its worth, I have this in my CMakeLists.txt:

                set(linked_libraries
                PUBLIC Qt5::Core
                PUBLIC Qt5::Sql.....

                Qt5::Core works "out of the box" as you would expect but Qt5::Sql is somehow not found.

                C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 15 Jun 2022, 17:47 last edited by
                #6

                @ReneUafasah said in Installing Qt Sql (qt verion 5):

                set(linked_libraries
                PUBLIC Qt5::Core
                PUBLIC Qt5::Sql.....

                here you only set a variable, you don't do anything with your target...

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1
                • S SGaist
                  15 Jun 2022, 17:36

                  Hi,

                  If you are on Linux, are you sure you are using the Qt version from the online installer and the one from your distribution ?

                  R Offline
                  R Offline
                  ReneUafasah
                  wrote on 15 Jun 2022, 20:16 last edited by
                  #7

                  @SGaist I am using Windows

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 15 Jun 2022, 20:24 last edited by
                    #8

                    Can you share your CMakeLists.txt ?

                    As @Christian-Ehrlicher suggested, there's something wrong with it.

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

                    R 1 Reply Last reply 16 Jun 2022, 07:13
                    0
                    • S SGaist
                      15 Jun 2022, 20:24

                      Can you share your CMakeLists.txt ?

                      As @Christian-Ehrlicher suggested, there's something wrong with it.

                      R Offline
                      R Offline
                      ReneUafasah
                      wrote on 16 Jun 2022, 07:13 last edited by
                      #9

                      @SGaist

                      Thanks for the request. I share what I can for now.
                      I have this in the Utils.cmake file: ( in a cmake folder in root directory):

                      macro(xxx_find_qt5_package)
                          find_package(Qt5 5.12 COMPONENTS Core Network Sql REQUIRED)
                      endmacro()
                      

                      It is then called in the main CMakeLists.txt, in the root folder.

                      xxx_find_qt5_package()
                      

                      when I click in the "Configure" button in the CMake GUI program, I see_

                      ....
                      -- The following REQUIRED packages have been found:
                      
                       * Qt5Core
                       * Qt5Network
                       * Qt5Sql
                       * Qt5 (required version >= 5.12)
                      
                      Configuring done
                      Generating done
                      

                      I am not sure if sharing any other parts of cmakeLists.txt can help.
                      Hmm , I think need to see why other packages (Qt5Network) dont have path problems.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 16 Jun 2022, 09:23 last edited by
                        #10

                        Then again, as @Christian-Ehrlicher, the issue is how you link them to your application and that is what you should show.

                        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
                        • R Offline
                          R Offline
                          ReneUafasah
                          wrote on 16 Jun 2022, 10:04 last edited by
                          #11

                          The following change in the CMakeLists.txt folder inside the client library that uses the persistence libraries (which contain Qt Sql)

                          set(linked_libraries
                                      PUBLIC Qt5::Core
                                      PUBLIC Qt5::Network
                          
                          
                                      PUBLIC my-api::persistence # This line was added
                                 )
                          
                          1 Reply Last reply
                          0

                          1/11

                          15 Jun 2022, 15:42

                          • Login

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