Search code examples
databaseoracle-databaseqtqmakeoracle-call-interface

Qt building OCI plugin


I'm trying to connect to Oracle DB using Qt on WinXp. In order to use QSql following Qt instruction I downloaded source necessary to build the Qt plugins for DB access (I need QOCI). According to Qt documentation I should run the following:

 set INCLUDE=%INCLUDE%;c:\oracle\oci\include
 set LIB=%LIB%;c:\oracle\oci\lib\msvc
 cd %QTDIR%\src\plugins\sqldrivers\oci
 qmake oci.pro
 nmake

But I get the following errors:

C:\QtSDK\Desktop\Qt\4.7.4\mingw\src\plugins\sqldrivers\oci>mingw32-make
mingw32-make -f MakeFile.Debug
mingw32-make[1]: Entering directory `C:/QtSDK/Desktop/Qt/4.7.4/mingw/src/plugins/sqldrivers/oci'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_L
IB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\.
.\..\include" -I"..\..\..\..\include\ActiveQt" -I"debug" -I"..\..\..\..\mkspecs\default" -o debug\main.o main.cpp
In file included from main.cpp:44:
../../../sql/drivers/oci/qsql_oci.h:47:46: error: QtSql/private/qsqlcachedresult_p.h: No such file or directory
In file included from main.cpp:44:
../../../sql/drivers/oci/qsql_oci.h:68: error: expected class-name before '{' token
../../../sql/drivers/oci/qsql_oci.h:80: error: 'ValueCache' has not been declared
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory `C:/QtSDK/Desktop/Qt/4.7.4/mingw/src/plugins/sqldrivers/oci'
mingw32-make: *** [debug] Error 2

Solution

  • I've found the answer. Oracle doesn't support mingw compiler and the plugin for Qt must be build with msvc.