Database Qt构建OCI插件

Database Qt构建OCI插件,database,oracle,qt,qmake,oracle-call-interface,Database,Oracle,Qt,Qmake,Oracle Call Interface,我正在尝试在WinXp上使用Qt连接到Oracle DB。为了按照Qt指令使用QSql,我下载了构建用于DB访问的Qt插件所需的源代码(我需要QOCI)。根据Qt文档,我应该运行以下程序: 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 但我得到以下错误:

我正在尝试在WinXp上使用Qt连接到Oracle DB。为了按照Qt指令使用QSql,我下载了构建用于DB访问的Qt插件所需的源代码(我需要QOCI)。根据Qt文档,我应该运行以下程序:

 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
但我得到以下错误:

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
它找不到位于
C:\Qt\SDK\Desktop\Qt\4.7.4\mingw\include
的标题。看起来makefile认为它在
/sql/drivers/
中,而不是
/sqldrivers/
中。有几种方法可以解决这个问题,我不知道错误是在于插件的发布还是Qt移动了它们

编辑: 嗯,第一点本身并没有错,但我不认为这是全部。使用Qt Creator下载时,标题的目录结构与作为下载时不同


我的建议是找到源代码的正确版本,下载,然后试着用它来构建。你必须弄清楚自己应该在层次结构中的什么位置(因为我以前从未构建过插件),但是在构建源代码时,你应该运气更好

我找到了答案。Oracle不支持mingw编译器,Qt插件必须使用msvc构建

正如我所检查的,qsqlcachedresult_p.h仅位于C:\QtSDK\QtSources\4.7.4\src\sql\kernel中。我尝试使用msvc进行编译-它给出了相同的结果。