windows下编译Oracle驱动插件QOCI

Qt帮助文档中提到的编译方法如下:

How to Build the OCI Plugin on WindowsChoosing the option “Programmer” in the Oracle Client Installer from the Oracle Client Installation CD is sufficient to build the plugin.

Buildthepluginasfollows(hereitisassumedthatOracleClientisinstalledinC:\oracle):

setINCLUDE=%INCLUDE%;c:\oracle\oci\includesetLIB=%LIB%;c:\oracle\oci\lib\msvccd%QTDIR%\src\plugins\sqldrivers\ociqmakeoci.pronmake

IfyouarenotusingaMicrosoftcompiler,replacenmakewithmakeinthelineabove.

Whenyourunyourapplicationyouwillalsoneedtoaddtheoci.dllpathtoyourPATHenvironmentvariable:

setPATH=%PATH%;c:\oracle\bin

Note: This database plugin is not supported for Windows CE.

本人按以上方法编译不成功,nmake一大堆错,mingw32-make也不行。

经仔细检查,发现是找不到oracle相关文件导致的,因此,修改qmake指令参数如下:

qmake "INCLUDEPATH+=c:\oracle\oci\include" "LIBS+=-Lc:\oracle\oci\lib\msvc" oci.pro

然后调用mingw32-make,搞定!

相关推荐