Windows 在Qt中创建Oci驱动程序时未找到头文件

Windows 在Qt中创建Oci驱动程序时未找到头文件,windows,qt,makefile,oracle-call-interface,mingw32,Windows,Qt,Makefile,Oracle Call Interface,Mingw32,我按照中给出的windows说明编译了Oracle Oci驱动程序 直到最后一步,我用mingw32-make替换nmake,一切都很顺利。 我明白了 mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory `C:/QtSDK/QtSources/4.7.4/src/sql/drivers/oci' g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT

我按照中给出的windows说明编译了Oracle Oci驱动程序

直到最后一步,我用mingw32-make替换nmake,一切都很顺利。 我明白了

mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/QtSDK/QtSources/4.7.4/src/sql/drivers/oci'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\
Desktop\Qt\4.7.4\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\includ
e\QtGui" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"c:\QtSDK\Desktop\Qt\4.7.
4\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mkspecs\d
efault" -o debug\qsql_oci.o qsql_oci.cpp
In file included from qsql_oci.cpp:42:
qsql_oci.h:47:46: error: QtSql/private/qsqlcachedresult_p.h: No such file or dir
ectory
qsql_oci.cpp:50:23: error: qsqlerror.h: No such file or directory
qsql_oci.cpp:51:23: error: qsqlfield.h: No such file or directory
qsql_oci.cpp:52:23: error: qsqlindex.h: No such file or directory
qsql_oci.cpp:53:23: error: qsqlquery.h: No such file or directory
qsql_oci.cpp:65:17: error: oci.h: No such file or directory
接下来是很多错误,但我想所有这些都与make无法找到头文件有关。谁能告诉我为什么会这样?正如前两个步骤中给出的那样,我确实正确地包含了所有要包含和LIB的路径

更新

我修改了qmake-project创建的.pro文件,并添加了
QT+=sql
,所有与sql相关的头错误都消失了,但第一个
qsqlcachedresult\u p.h
和最后一个
oci.h
仍然存在。

尝试将
include\QtSql
添加到
-I
选项中。我不知道在这种环境下如何做到这一点,但可能是跑步

set CPP_FLAGS="-Ic:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql"

在执行
make
命令之前。

要解决剩下的两个标题问题,下面是我所做的-

  • 对于oci.h文件,手动编辑makefile.release和makefile.debug,以在INCPATH变量中包含头的路径。(类似于-I“C:\XEClient\oci\include”)

  • qsqlcachedresult_p.h位于QT/src/sql/kernel目录中。因此,我将头文件复制到一个新目录C:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtSql\private

  • 编译后没有错误


    这篇文章帮了大忙-。

    你的系统上
    qsqlerror.h
    的实际位置在哪里?我猜不是在
    -I
    选项中传递给g++的路径中,这可能是错误的原因。我检查了。我的所有标题都位于c:\QtSDK\Desktop\Qt\4.7.4\mingw\include。这包括在g++/I修改.pro文件的参数中,但其他两个错误仍然存在。更新了我的问题。非常感谢。我懂了。因此,仍有2个文件未解析。也许他们期待一个不同的qt版本?使用
    oci.h
    应该很容易,只需添加另一个
    -I
    目录即可。但是如果没有路径QtSql/private/qsqlcachedresult_p.h,那么现在可能无法编译。无论如何,这里需要一个对QT有更好了解的人。