(I'm running on Win XP SP3 by the way)
Everything seemed to lead me to a dead-end, so I did the following:
I uninstalled everything that had anything to do with Qt and Oracle
I got the Oracle Database 10g Express Client from http://www.oracle.com/technetwork/da...ft-090667.html and installed it to its default path C:\XEClient
I got Qt SDK 1.1.1 (offline installer) from http://qt.nokia.com/downloads and made a custom installation. From the components I checked Documentation, Qt Examples, MinGW 4.4, Qt Designer, Desktop Qt 4.7.3 - MINGW and Qt Linguist. I installed it to its default path of C:\QtSDK
Just to make sure (don't know excactly why) I reinstalled also Microsoft Visual C++ 2010 Express http://www.microsoft.com/express/Dow...010-Visual-CPP
Then when everything was (re)installed, I started the Maintain Qt SDK tool found from the Start menu or through Qt Creator (Help - Start updater). From there (from Package manager tab) I checked under Miscellaneous - Qt Sources the Qt 4.7.3 Sources component.
Then I set the environment variables (right click my computer - properties - advanced - environment variables) and added there LIB with value C:\XEClient\oci\lib\msvc and INCLUDE with value C:\XEClient\oci\include
After this I ran the Qt 4.7.3 for Desktop (MinGW) command prompt from the start menu and I wrote in the following
set QTDIR=C:\QtSDK\QtSources\4.7.3
cd %QTDIR%\src\plugins\sqldrivers\oci
qmake oci.pro
set QTDIR=C:\QtSDK\QtSources\4.7.3
cd %QTDIR%\src\plugins\sqldrivers\oci
qmake oci.pro
To copy to clipboard, switch view to plain text mode
If I recall correctly everything worked fine until this point. Then I tried to run nmake but then I got an error that C:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtSql directory was missing a file, private\qsqlcachedresult_p.h so I searched for that file and I found it from C:\QtSDK\QtSources\4.7.3\src\sql\kernel directory, so I created a the missing directory C:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtSql\priv ate and copied the qsqlcachedresult_p.h there.
After that I tried to run nmake again but it still puked on my face, complaining about missing oci.h file. So I manually edited Makefile.release and Makefile.debug files in %QTDIR%\src\plugins\sqldrivers\oci. I added there in the INCPATH section the following: -I"C:\XEClient\oci\include"
Now I everything should be ready to run
nmake
nmake
To copy to clipboard, switch view to plain text mode
FINALLY after that nmake didn't complain about anything and it made the following files in the %QTDIR%\src\plugins\sqldrivers\oci\debug directory:
- libsqlocid4.a
- main.o
- moc_qsql_oci.cpp
- moc_qsql_oci.o
- qsql_oci.o
- qsqlocid3.dll
- qsqlocid_resource_res.o
After that I ran
nmake release
nmake release
To copy to clipboard, switch view to plain text mode
which gave me the following files to %QTDIR%\src\plugins\sqldrivers\oci\release directory:
- libsqloci4.a
- main.o
- moc_qsql_oci.o
- qsql_oci.o
- qsqloci4.dll
- qsqloci_resource_res.o
So now I should have the OCI plugin. According to my notions, the .a and .dll files from both debug and release folders should be copied to C:\QtSDK\Desktop\Qt\4.7.3\mingw\plugins\sqldrivers directory
This way when I run my build in Debug or Release mode the code
qDebug() << QSqlDatabase::drivers();
To copy to clipboard, switch view to plain text mode
Shows in debug screen that I have QOCI and QOCI8 available.
HOWEVER. I am now getting the following error when I try to use
QSqlDatabase::addDatabase("QOCI")
To copy to clipboard, switch view to plain text mode
QObject::moveToThread: Current thread (0x3e5448) is not the object's thread (0xa17de28).
Cannot move to target thread (0x3e5448)
Now, is there anyone who could tell what is wrong here?
Bookmarks