how to build QOCI (for linux and windows)

How to build QOCI under linux platform:

1st:

cd $QTDIR/src/plugins/sqldrivers/oci

2nd:

qmake "INCLUDEPATH+=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/public /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/demo" "LIBS+=-L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib" oci.pro      

//确保oci.h能包含在include path里,可以先在oracle的目录下找到该文件

3rd:

make

 

 

Details:

 

How to Build OCI Plugin

#Login as root by typing,

su

#Type the root user password and press enter.

 

#Make the source folder by typing,

mkdir /usr/local/Trolltech/Qt-4.4.3/src

 

#copy the source for building the Oracle OCI plugin

cp -R /home/bj/QT/qt-x11-commercial-src-4.4.3/src/plugins /usr/local/Trolltech/Qt-4.4.3/src

cp -R /home/bj/QT/qt-x11-commercial-src-4.4.3/src/sql /usr/local/Trolltech/Qt-4.4.3/src

cp -R /home/bj/QT/qt-x11-commercial-src-4.4.3/include/QtSql/private /usr/local/Trolltech/Qt-4.4.3/lib/QtSql

 

#Change the current folder to the oci folder by typing,

cd /usr/local/Trolltech/Qt-4.4.3/plugins/src/sqldrivers/oci

 

#Note: the qmake suggested by the Trolltech webpage caused an error so the second qmake below was modified to remove the error

#qmake -o Makefile "INCLUDEPATH+=$ORACLE_HOME/rdbms/public $ORACLE_HOME/rdbms/demo" "LIBS+=-L$ORACLE_HOME/lib -lclntsh -lwtc8" oci.pro

 

#Pre build the files by typing,

qmake -o Makefile "INCLUDEPATH+=$ORACLE_HOME/rdbms/public $ORACLE_HOME/rdbms/demo" "LIBS+=-L$ORACLE_HOME/lib -lclntsh" oci.pro

 

#Build the files by typing,

make

你可能感兴趣的:(QT,数据库)