How to create the plugin of OCI for Qt
-
No, Windows 64 can run 32 bit applications. What you are doing is trying to link a 64 bit library to a 32 bit one, which is not possible.
Are you sure you gave the correct path ?
-
I saw run everything.
oracle client qt
32bit 32bit
64bit 32bit
64bit 64bit
32bit 64bitBut that was not the case successfully.
If possible run in 64bit 32bit
Why 32bit - 32bit is running does not?
Also, why does not run 64bit-64bit?
Were given the right path.
error is the "can not opened oci.lib"
because lib file is found this error occurs
I think so.I would not find a solution in this case.
It is imperative for your help.
please help me. sorry -
Please, ensure that you are using either both 32bit or 64bit version of the libraries (I mean Qt and Oracle) Next, check the compiler used to build Oracle's library and choose the one that matches with your Qt installation
-
Answer Thank you.
So I checked.
I installed qt mingw4.8.2 (32bit) and oracle client-win32 runtime (32bit).
Is there something wrong here?
Or do I need to add that same environment variables?
: -1: Error: can not find -loci
that can not find the oci libraries it?
I do not know why would not find the library. -
Can you post the path where this lib can be found ? Not the one you are using but the explorer's path
-
C:\app\yeongkyu\product\11.2.0\client_2\oci\lib\msvc
oci.lib is here.C:\app\yeongkyu\product\11.2.0\client_2\oci\include
oci.h is here.C:\Qt\5.3\Src\qtbase\src\plugins\sqldrivers\oci
oci.pro is hereC:\app\yeongkyu\product\11.2.0\client_2\BIN
dll file is here.I have not touched since the Oracle installation.
just Path and have only set up the build.
only the lib and include paths -
What else do you have in C:\app\yeongkyu\product\11.2.0\client_2\oci\lib\ ?
-
Answer Thank you.
But it also does not work.
So I tried the other way attempt.
I copy mingw32 / bin the dll file in the oracle_home / client / bin.
I copy mingw32 / include the all file in the oracle_home / client / oci / include.
I copy mingw32 / lib lib file in the oracle_home / client / oci / lib / msvc.
qt 5.3 for desktop (mingw4.8 32bit) .exe
-> cd c: \ qt \ 5.3 \ src \ qtbase \ src \ plugins \ sqldrivers \ oci
-> qmake oci.pro
-> mingw32-make
In this way I
lbisqloci.a
qsqloci.dll
qsqlocid.dll
I created three files.
Success!
But can not open the db.QOCIDriver: unable to create environment
OCIHandleAlloc segmentation faultThe source is as follows:
@ QSqlDatabase db;
db = QSqlDatabase::addDatabase("QOCI8");
db.setHostName("hostip");
db.setDatabaseName("dbname");
db.setUserName("userid");
db.setPassword("userpw");
db.setPort(1521);
db.open();
@
Error is it because I had the wrong source code?
Or so the plug incorrectly created?I would like to thank again
the project be conducted . -
No, probably the wrong dll loading
-
Your answer is right.
Plug was incorrectly made.
I have succeeded in making the plug-in using the plug-in method of making oci provided by qt.But Oracle Tns error occurs.
ORA-12154: the specified connection identifier cannot be analyzed
Unable to logonThis is a reference when creating a plugin
This is specified when creating a plug-in to see qsql_oci.cpp@
connectionString =
QString::fromLatin1("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=%1)(Port=%2))"
"(CONNECT_DATA=(SERVICE_NAME=%3)))").arg(hostname).arg((port > -1 ? port : 1521)).arg(db)@Configure the TNS that the source of that I think.
The TNS using sqlplus and I have successfully completed the database connection
Is that different, and this part of the TNS version of DB? -
I've solved.
This is because you are helping.@connectionString =
QString::fromLatin1("(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=%1)(PORT=%2)))"
"(CONNECT_DATA=(SERVICE_NAME=%3)))").arg(hostname).arg((port > -1 ? port : 1521)).arg(db);@This was resolved by modifying the.
Thanks .T_T