Windows下編譯Oracle驅動開啟工程:C:\Qt\4.8.1\src\plugins\sqldrivers\oci修改oci.pro:TARGET = qsqlociSOURCES = main.cppinclude(../../../sql/drivers/oci/qsql_oci.pri)include(../qsqldriverbase.pri)INCLUDEPATH += D:\oracle2\product\11.2.0\dbhome_1\OCI\includeLIBPATH += D:\oracle2\product\11.2.0\dbhome_1\OCI\lib\MSVC編譯完成後,複製庫檔案到:C:\Qt\4.8.1\plugins\sqldriversqsqloci4.libqsqlocid4.libqsqloci4.dllqsqlocid4.dllLinux下編譯Oracle驅動開啟工程:/usr/local/qt-4.5.2/src/plugins/sqldrivers/oci檢視並修改工程檔案oci.pro :[d5000@CentOS6-64 oci]$ cat oci.pro TARGET = qsqlociHEADERS = ../../../sql/drivers/oci/qsql_oci.hSOURCES = main.cpp \ ../../../sql/drivers/oci/qsql_oci.cppLIBPATH += /u01/app/oracle/libwin32:LIBS *= -lociunix:!contains( LIBS, .*clnts.* ):LIBS *= -lclntshmacx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environinclude(../qsqldriverbase.pri)編譯完成後複製到相應目錄。
Windows下編譯Oracle驅動開啟工程:C:\Qt\4.8.1\src\plugins\sqldrivers\oci修改oci.pro:TARGET = qsqlociSOURCES = main.cppinclude(../../../sql/drivers/oci/qsql_oci.pri)include(../qsqldriverbase.pri)INCLUDEPATH += D:\oracle2\product\11.2.0\dbhome_1\OCI\includeLIBPATH += D:\oracle2\product\11.2.0\dbhome_1\OCI\lib\MSVC編譯完成後,複製庫檔案到:C:\Qt\4.8.1\plugins\sqldriversqsqloci4.libqsqlocid4.libqsqloci4.dllqsqlocid4.dllLinux下編譯Oracle驅動開啟工程:/usr/local/qt-4.5.2/src/plugins/sqldrivers/oci檢視並修改工程檔案oci.pro :[d5000@CentOS6-64 oci]$ cat oci.pro TARGET = qsqlociHEADERS = ../../../sql/drivers/oci/qsql_oci.hSOURCES = main.cpp \ ../../../sql/drivers/oci/qsql_oci.cppLIBPATH += /u01/app/oracle/libwin32:LIBS *= -lociunix:!contains( LIBS, .*clnts.* ):LIBS *= -lclntshmacx:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environinclude(../qsqldriverbase.pri)編譯完成後複製到相應目錄。