Firebird Driver for Qt 6.6
-
Good afternoon. There is no way to build a driver for Firebird in Qt 6.6 under Windows. Has anyone tried it? Previously, in version Qt 5.12 it was much easier, but now Qt6 is forced to use CMake and Ninja to build SQL drivers and this bundle does not work. And the old driver project from 5.12 requires too many things, which are now removed in 6.6.
The build files that Qt provides need to be finalized, because there are default paths everywhere. I edited them all. Configured all paths. But this is the way out:
C:\Users\user>C:\Qt\6.6.0\mingw_64\bin\qt-cmake-user -G Ninja -DCMAKE_MAKE_PROGRAM="C:\Qt\Tools\Ninja\ninja.exe" -S C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers -B C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers\ibase\build -DInterbase_INCLUDE_DIR="H:\Qt\Firebird_3.0\Firebird_3_0\include " -DInterbase_LIBRARY="H:\Qt\Firebird_3.0\Firebird_3_0\lib\fbclient_ms.lib "
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: C:/Qt/Tools/mingw1120_64/bin/gcc.exe
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Qt/Tools/mingw1120_64/bin/g++.exe
-- Check for working CXX compiler: C:/Qt/Tools/mingw1120_64/bin/g++.exe - broken
CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.24/Modules/CMakeTestCXXCo mpiler.cmake:62 (message):
The C++ compiler"C:/Qt/Tools/mingw1120_64/bin/g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Qt/6.6.0/Src/qtbase/src/plugins/sqldrivers/ibase/build/CM akeFiles/CMakeTmp
Run Build Command(s):C:\Qt\Tools\Ninja\ninja.exe cmTC_29d4b && [1/2] Building CXX object CMakeFiles\cmTC_29d4b.dir\testCXXCompiler.cxx.obj
FAILED: CMakeFiles/cmTC_29d4b.dir/testCXXCompiler.cxx.obj
C:\Qt\Tools\mingw1120_64\bin\g++.exe -o CMakeFiles\cmTC_29d4b.dir\testCXXCompiler.cxx.obj -c C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers\ibase\build\CM akeFiles\CMakeTmp\testCXXCompiler.cxx
ninja: build stopped: subcommand failed. -
-
Building an SQL driver for Qt6.
Valid for software versions:
Windows 10 Pro x64 22H2 19045.2006 120.2212.4180.0
Qt 6.6.0
Qt Creator 11.0.3 (6.4.3, MSVC 2019, x86_64)
MinGW 11.2.0 x64
CMake 3.24.2
Ninja 28.11.2020 15:06
Firebird 3.0.11.11703The official documentation on this issue describes a parallel reality with a spherical driver in vacuum.
- Qt must be installed with the source code.
- Firebird must be installed with the source code.
- By default Firebird is installed here:
C:\Program Files\Firebird
A space in the name of the "Program Files" folder makes it impossible to build the driver. Therefore, we make a copy to build the driver here:
H:\Qt\Firebird - Create a folder to build the driver here:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release
The folder should be empty. If the folder already exists, then you need to delete all the contents from it. - Check the driver sources here:
C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers
There should be a file there CMakeLists.txt , it will be needed.
And there should not be a CMakeLists.txt.user file, it will be created later. If this file exists, we delete it. - Open Qt Creator. Menu "File", "Open file or project" and open this file:
C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers\CMakeLists.txt - Select the necessary compiler: MinGW 11.2.0 x64.
On the right, expand the additional settings and uncheck all the build options except Release.
Apply the changes (button, lower right corner). - In the "Editor" mode, the "QSQLiteDriverPlugin" project opens, which will have subfolders corresponding to different types of databases, but the "ibase" subfolder for the Firebird driver will not be there.
- Switch to the "Projects" mode. Check that the "Build directory" is correct:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release . - Below we are working with the "Current Configuration" tab.
The key "FEATURE_sql_ibase" in the table will have the value "OFF".
To make the settings, check the "Advanced" on the right. - There is a search field above the table of keys and values. We enter Interbase_INCLUDE_DIR there. Changing the key value to
H:\Qt\Firebird\Firebird_3_0\include
To save the changes, click on the name of the key, i.e. on the text Interbase_INCLUDE_DIR. - In the search, enter Interbase_LIBRARY and change the value of this key to
H:\Qt\Firebird\Firebird_3_0\lib\fbclient_ms.lib
To save the changes, click on the name of the key. - Uncheck "Advanced".
- Under the key table, click the "Run CMake" button. You must agree to the request to apply key changes. You will be prompted to change three keys: two that have been edited and the third is FEATURE_sql_ibase with the new value "ON".
- Make sure that the key "FEATURE_sql_ibase" in the table now has the value "ON".
- Uncheck the checkboxes next to unnecessary keys such as: "FEATURE_sql_odbc" and "FEATURE_sql_sqlite".
- In the "Editor" mode, the "QSQLiteDriverPlugin" project will now have an "ibase" subfolder for the Firebird driver.
- Menu "Build", "Build the project "QSQLiteDriverPlugin"". If you are asked to apply changes to change the values of the keys "FEATURE_sql_odbc" and "FEATURE_sql_sqlite" to the "OFF" state, you should agree.
- The driver file, in case of a successful build, will be here:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release\plugins\sqldrivers\qsqlibase.dll - The file is copied to the folder
C:\Qt\6.6.0\mingw_64\plugins\sqldrivers
and also where you need it to copy to.
-
This has nothing to do with cmake nor ninja. Are you sure g++.exe exists in the given directory? Try to execute it on the command line.
-
@Christian-Ehrlicher, hello. Thank you. Yes, the file really exists there, because I specified this path myself. It responds.
C:\Users\user>C:\Qt\Tools\mingw1120_64\bin\g++
g++: fatal error: no input files
compilation terminated. -
But as you can see there is a problem creating a simple executable with it. Create a simple main.cpp and try to compile it on the command line. I would guess there are some errors as the environment for the compiler is not properly set up.
Also the official documentation suggest to create a build directory and build the stuff in there instead in the source directory. -
Building an SQL driver for Qt6.
Valid for software versions:
Windows 10 Pro x64 22H2 19045.2006 120.2212.4180.0
Qt 6.6.0
Qt Creator 11.0.3 (6.4.3, MSVC 2019, x86_64)
MinGW 11.2.0 x64
CMake 3.24.2
Ninja 28.11.2020 15:06
Firebird 3.0.11.11703The official documentation on this issue describes a parallel reality with a spherical driver in vacuum.
- Qt must be installed with the source code.
- Firebird must be installed with the source code.
- By default Firebird is installed here:
C:\Program Files\Firebird
A space in the name of the "Program Files" folder makes it impossible to build the driver. Therefore, we make a copy to build the driver here:
H:\Qt\Firebird - Create a folder to build the driver here:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release
The folder should be empty. If the folder already exists, then you need to delete all the contents from it. - Check the driver sources here:
C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers
There should be a file there CMakeLists.txt , it will be needed.
And there should not be a CMakeLists.txt.user file, it will be created later. If this file exists, we delete it. - Open Qt Creator. Menu "File", "Open file or project" and open this file:
C:\Qt\6.6.0\Src\qtbase\src\plugins\sqldrivers\CMakeLists.txt - Select the necessary compiler: MinGW 11.2.0 x64.
On the right, expand the additional settings and uncheck all the build options except Release.
Apply the changes (button, lower right corner). - In the "Editor" mode, the "QSQLiteDriverPlugin" project opens, which will have subfolders corresponding to different types of databases, but the "ibase" subfolder for the Firebird driver will not be there.
- Switch to the "Projects" mode. Check that the "Build directory" is correct:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release . - Below we are working with the "Current Configuration" tab.
The key "FEATURE_sql_ibase" in the table will have the value "OFF".
To make the settings, check the "Advanced" on the right. - There is a search field above the table of keys and values. We enter Interbase_INCLUDE_DIR there. Changing the key value to
H:\Qt\Firebird\Firebird_3_0\include
To save the changes, click on the name of the key, i.e. on the text Interbase_INCLUDE_DIR. - In the search, enter Interbase_LIBRARY and change the value of this key to
H:\Qt\Firebird\Firebird_3_0\lib\fbclient_ms.lib
To save the changes, click on the name of the key. - Uncheck "Advanced".
- Under the key table, click the "Run CMake" button. You must agree to the request to apply key changes. You will be prompted to change three keys: two that have been edited and the third is FEATURE_sql_ibase with the new value "ON".
- Make sure that the key "FEATURE_sql_ibase" in the table now has the value "ON".
- Uncheck the checkboxes next to unnecessary keys such as: "FEATURE_sql_odbc" and "FEATURE_sql_sqlite".
- In the "Editor" mode, the "QSQLiteDriverPlugin" project will now have an "ibase" subfolder for the Firebird driver.
- Menu "Build", "Build the project "QSQLiteDriverPlugin"". If you are asked to apply changes to change the values of the keys "FEATURE_sql_odbc" and "FEATURE_sql_sqlite" to the "OFF" state, you should agree.
- The driver file, in case of a successful build, will be here:
H:\Qt\build-sqldrivers-Desktop_Qt_6_6_0_MinGW_64_bit-Release\plugins\sqldrivers\qsqlibase.dll - The file is copied to the folder
C:\Qt\6.6.0\mingw_64\plugins\sqldrivers
and also where you need it to copy to.
-