Installing Qt Sql (qt verion 5)
-
wrote on 15 Jun 2022, 15:42 last edited by
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
-
Then again, as @Christian-Ehrlicher, the issue is how you link them to your application and that is what you should show.
-
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
@ReneUafasah said in Installing Qt Sql (qt verion 5):
Where do I find it?
It's already installed with the base Qt installation.
-
wrote on 15 Jun 2022, 15:58 last edited by
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.
-
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 ?
-
wrote on 15 Jun 2022, 17:46 last edited by
Do you have a line like this (or combined with other Qt modules) in your CMakelLists.txt file:
find_package(Qt5Sql REQUIRED)
-
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.
@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...
-
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 ?
wrote on 15 Jun 2022, 20:16 last edited by@SGaist I am using Windows
-
Can you share your CMakeLists.txt ?
As @Christian-Ehrlicher suggested, there's something wrong with it.
-
Can you share your CMakeLists.txt ?
As @Christian-Ehrlicher suggested, there's something wrong with it.
wrote on 16 Jun 2022, 07:13 last edited byThanks 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. -
Then again, as @Christian-Ehrlicher, the issue is how you link them to your application and that is what you should show.
-
wrote on 16 Jun 2022, 10:04 last edited by
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/11