How to compile the Oracle driver in Qt

Source: Internet
Author: User
Compile the Oracle driver in Windows to open the project: C: Qt4.8.1srcpluginssqldriversoci modify oci. pro: TARGETqsqlociSOURCESmain. c

Compile the Oracle driver in Windows to open the project: C: \ Qt \ 4.8.1 \ src \ plugins \ sqldrivers \ oci modify oci. pro: TARGET = qsqloci SOURCES = main. c

Compile the Oracle driver in Windows

Open the project:
C: \ Qt \ 4.8.1 \ src \ plugins \ sqldrivers \ oci

Modify oci. pro:

TARGET = qsqloci

SOURCES = main. cpp
Include (.../../SQL/drivers/oci/qsql_oci.pri)

Include (../qsqldriverbase. pri)

INCLUDEPATH + = D: \ oracle2 \ product \ 11.2.0 \ dbhome_1 \ OCI \ include
LIBPATH + = D: \ oracle2 \ product \ 11.2.0 \ dbhome_1 \ OCI \ lib \ MSVC

After compilation, copy the library file:
C: \ Qt \ 4.8.1 \ plugins \ sqldrivers


Qsqloci4.lib
Qsqlocid4.lib

Qsqloci4.dll
Qsqlocid4.dll

Compile the Oracle driver in Linux

Open the project:
/Usr/local/qt-4.5.2/src/plugins/sqldrivers/oci

View and modify the project file oci. pro:
[D5000 @ CentOS6-64 oci] $ cat oci. pro
TARGET = qsqloci

HEADERS =.../../SQL/drivers/oci/qsql_oci.h
SOURCES = main. cpp \
.../SQL/drivers/oci/qsql_oci.cpp

LIBPATH + =/u01/app/oracle/lib

Win32: LIBS * =-loci

Unix :! Contains (LIBS,. * clcnt. *): LIBS * =-lclntsh

Macx: QMAKE_LFLAGS + =-Wl,-flat_namespace,-U, _ environ

Include (../qsqldriverbase. pri)

After compilation, copy it to the corresponding directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.