我正在尝试在 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