Unsolved Oracle database connection failure
-
I don`t know how to set up the environment. Here is the error message in Qt:
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
"Driver not loaded Driver not loaded". -
@Atiker
You do not have theQOCI
driver available, which is what you will need for Oracle. The above topics discuss this and what you have to do. My reading is that it does not come distributed with Qt (possible copyright reasons), and you have to build it yourself.
https://stackoverflow.com/questions/17601662/how-to-build-qt-qoci-oracle-database-driver-on-windows-with-mingw
Unless someone says otherwise.... -
That article doesn`t work on my pc. Here is the mingw command line:
C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\includeC:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc
C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro
C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>
-
mingw32-make[1]: Entering directory 'C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/oci'
mingw32-make[1]: Nothing to be done for 'first'.So, have you either looked to see what is already present in that directory, or made sure you've done a full "clean" before building? Why does it say nothing to be done for 'first'? You can look at the makefile.
Or wait for someone else to come here and tell you exactly what to do.....
-
Let me just reinstall Qt and try it again!:((
-
@Atiker
Worth a try :)Take this with a pinch of salt --- bearing in mind I know nothing --- but:
set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc
Is that
msvc
at the end right formingw
? I thoughtmsvc
was for Microsoft VC libs? But don't get hung up on this, as it's only something which might look odd to me.... -
There is another error encountered :((
C:\Qt\5.10.0\mingw53_32>cd C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\ociC:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set INCLUDE=%INCLUDE%;C:\app\aliati\product\12.2.0\dbhome_1\oci\include
C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>set LIB=%LIB%;C:\app\aliati\product\12.2.0\dbhome_1\oci\lib\msvc
C:\Qt\5.10.0\Src\qtbase\src\plugins\sqldrivers\oci>qmake oci.pro
Cannot read C:/Qt/5.10.0/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: The system cannot find the file specified.
Project ERROR: Library 'oci' is not defined.AnyHelp.exec();
-
@Atiker You can't use libraries for MSVC compiler with MinGW and other way around.
-
Is there any other appropriate method to build QOCI driver?
-
@Atiker said in Oracle database connection failure:
Project ERROR: Library 'oci' is not defined.
Have you taken a look at this post?
Also this bug report may help you.
Just in case, have you have properly installed Oracle supporting libraries?