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)

Installing Qt Sql (qt verion 5)

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 1.5k 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.
  • ReneUafasahR Offline
    ReneUafasahR Offline
    ReneUafasah
    wrote on 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

    Christian EhrlicherC 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      • ReneUafasahR ReneUafasah

        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

        Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 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
        • ReneUafasahR Offline
          ReneUafasahR Offline
          ReneUafasah
          wrote on 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.

          Christian EhrlicherC 1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on 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

            ReneUafasahR 1 Reply Last reply
            1
            • M Offline
              M Offline
              mchinand
              wrote on 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
              • ReneUafasahR ReneUafasah

                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.

                Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 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
                • SGaistS SGaist

                  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 ?

                  ReneUafasahR Offline
                  ReneUafasahR Offline
                  ReneUafasah
                  wrote on last edited by
                  #7

                  @SGaist I am using Windows

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 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

                    ReneUafasahR 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Can you share your CMakeLists.txt ?

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

                      ReneUafasahR Offline
                      ReneUafasahR Offline
                      ReneUafasah
                      wrote on 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
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 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
                        • ReneUafasahR Offline
                          ReneUafasahR Offline
                          ReneUafasah
                          wrote on 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

                          • Login

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