Вопрос

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
Это было полезно?

Решение 2

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

Другие советы

It can't find the headers located at C:\Qt\SDK\Desktop\Qt\4.7.4\mingw\include. It looks like the makefile thinks it's in /sql/drivers/ rather than /sqldrivers/. There are several ways of fixing this, and I don't know whether the error lies in the release of the plugin or if Qt has moved them.

Edit: Well that first bit isn't wrong as such, but I don't think its the whole story. The headers have a different directory structure when downloaded with the Qt Creator as they have when downloaded as Qt source.

My edited advice would be to find the right version of the source, download it, and try building with that instead. You will have to figure out yourself where in the hierarchy that should be (as I've never built a plugin before) but you should have better luck when building against the source!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top