PDA

View Full Version : installing OCI driver



dilidpan
15th June 2009, 09:40
Hello,

I'm using Qt Creator 1.0.0 based on Qt 4.5.0 on system: Windows XP Professional ver.2002 service pack 3.
I've read a lot of stuffs about DB drivers and instalations, but I still have problem with installing the plugins.

I want to instal OCI driver, which I could use in my applications.

I've already set the System variables

INCLUDE = C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\;D:\oracle\product\10.2.0\cl ient_1\oci\include
and

LIB = C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Lib\;D:\oracle\product\10.2.0\client _1\oci\lib\msvc,
also

QMAKESPEC = win32-msvc.net;win32-msvc

QTDIR = C:\Qt\2009.01\qt

PATH = D:\oracle\product\10.2.0\client_1\bin.
When I run qmake in Visual Studio .NET 2003 Command Promt, I receive that 'qmake' is not recognized as an internal or external command, operable program or batch file.

Then I try ti run qmake, that's in QT Creator. In Compile output I read:

QMAKESPEC set to win32-msvc.net;win32-msvc overrides mkspec of selected qt win32-g++
Running build steps for project oci...
Starting: C:/Qt/2009.01/qt/bin/qmake.exe C:/Qt/2009.01/qt/src/plugins/sqldrivers/oci/oci.pro -spec win32-g++ -r CONFIG+=debug_and_release
Exited with code 0.

Please help me what to do?

nish
15th June 2009, 09:45
you can not use the qt sdk with visual studio.. you have to compile qt for visual studio from source

for this error
'qmake' is not recognized as an internal or external command, operable program or batch file.

you have to put the QTDIR\bin path to PATH

dilidpan
15th June 2009, 09:47
I'm using QT Creator for implementing the source code for my applications.
How to add OCI driver to it, I'm not using Visual Studio.

nish
15th June 2009, 09:53
i think the driver is loaded by a simple call to

QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");

and remember to at QT+=sql in your .pro file and reload the project.. QtCreator will take care of the rest

dilidpan
15th June 2009, 09:59
I did it so, but when I try to log to the DB I receive the following error:

QSqlDatabase: QOCI driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
So I thought that I should instalL this OCI driver. But I have the previous problems. And I don't know what to do?

nish
15th June 2009, 10:05
then you have to compile the OCI driver.
the is detailed chapter dedicated to plugins and sql drivers in qt assistant. but u must be having oracal includes files for that. i dont know where to find them

dilidpan
15th June 2009, 10:13
I have problems while trying to install OCI plugin. That was my question - for help where am I making mistake? And I explain all the steps that I've made.
When I run qmake for 'C:\Qt\2009.01\qt\src\plugins\sqldrivers\oci' it uses '-spec win32-g++'.
After that I run 'nmake' from Visual Studio .NET 2003 Command Prompt and have errors:

'g++' is not recognizd as an external command.
What am I missing?

nish
15th June 2009, 10:17
the makefile is ment to be compiled from gcc compiler and NOT the microsoft compiler..

the qt sdk comes with MinGW compiler... just locate the compiler direcotry.

now add path\to\mingw\bin to PATH

open command prompt and cd to OCI plugin

run make (not nmake)

dilidpan
15th June 2009, 11:44
Ok, I found MinGW, set PATHs and then run make on command prompt.
It started. After few minutes I recieved many errors like these:


C:/Qt/2009.01/qt/src/plugins/sqldrivers/oci/tmp/moc/debug_shared/moc_qsql_oci.cp
p:41: undefined reference to `_imp___ZN10QSqlDriver16staticMetaObjectE'
tmp/obj/debug_shared/moc_qsql_oci.o: In function `ZSt17__verify_groupingPKcjRKSs
':
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::event(QEvent*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::eventFilter(QObject
*, QEvent*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::timerEvent(QTimerEv
ent*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::childEvent(QChildEv
ent*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::customEvent(QEvent*
)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2499: undefined reference to `QObject::connectNotify(char
const*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2500: undefined reference to `QObject::disconnectNotify(ch
ar const*)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2500: undefined reference to `QSqlDriver::isOpen() const'
C:/Qt/2Creating library file: c:\Qt\2009.01\qt\plugins\sqldrivers\libqsqlocid4.a

009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/loc
ale_facets.tcc:2507: undefined reference to `QSqlDriver::sqlStatement(QSqlDriver
::StatementType, QString const&, QSqlRecord const&, bool) const'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2507: undefined reference to `QSqlDriver::setOpen(bool)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2506: undefined reference to `QSqlDriver::setOpenError(boo
l)'
C:/Qt/2009.01/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/b
its/locale_facets.tcc:2506: undefined reference to `QSqlDriver::setLastError(QSq
lError const&)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlocid4.dll] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/2009.01/qt/src/plugins/sqldrivers/oci'

mingw32-make: *** [debug-all] Error 2

Why?