Article View: borland.public.cppbuilder.database.multi-tier
Article #809I can't get Oracle OCI calls to link
From: Norman Dunbar
Date: Fri, 20 Oct 2000 00:00
Date: Fri, 20 Oct 2000 00:00
90 lines
4311 bytes
4311 bytes
Hi there,
I am trying to create a GUI app in Builder 4 Pro, which uses the Oracle OCI
library.
As I haven't done this before, I had a look at the samples for Borland that
came with Oracle 8.0.5 client.
I can run the make.bat file and create a working exe - so far so good - but
this is a console app, which is not what I wanted.
(There is an oci.lib file especially for Borland, but more of this later
.....)
When I created a new GUI app, and added the above mentioned lib file to it,
I get all sorts of unresolved linker errors for calls to olog(), oclose(),
oopen() etc which are all OCI calls.
So I created a new console project, added the Oracle supplied demo to it
(removing the Builder generated code) and tried again. Adding the oci.lib
from the oracle/oci80/lib/borland directory added a
USELIB("..\..\..\..\oracle\oci80\lib\borland\oci.lib"); line to the source.
This, when complied causes an "E2293 ')' expected" error on the USELIB
line.
OK, if you are still reading :
Q1 : why does it work in a dos window using BC5.02 and the library links
fine and the app executes fine when it won't even compile as a console app
in Builder ?
Q2 : Does USELIB actually work for console apps, if not (and it appears not)
how on eareth do I include a library in the link ?
Onwards. Undeterred by the lack of a console mode app, I went back to GUI
mode and tried again, same problem (obviously) as above. I then tried to
generate my own library as follows :
implib ora805.lib e:\oracle\bin\ora805.dll
This was then added to the project - with exactly the same results as above
(I did remove the other Oracle supplied library first though :o) )
OK, I shall try the -a option, so :
implib -a ora805_b.lib e:\oracle\bin\ora805.dll
again, I removed the other library and added this new one. Still the same -
all calls to olog(), oclose() etc were unresolved at link time.
Checking out the Oracle Tech Net pages, I found doc 61582.1 which deals with
this very problem on Oracle 7, I had followed the advice anyway in my
playing with implib, but they also recommend that the compiler generates
underscores. I checked my options and it was on anyway - turning it off
causes all the VCL stuff to be unresolved at link time :o(.
So, I resort to looking inside the 'working' lib file for BC5.02 - all the
names init have underscores.
I check my generated lib files and the ora805_b.lib file has also got
leading underscores - but still no joy.
I have tried the lib files with and without leading underscores, with and
without generated underscores from the compiler - nothing works. Every
single link failed with the unresolved reference to oxxxx() functions.
Obviously, there were varying other errors as well according to the compiler
options, but these were the important ones as they imply that the lib file
created is no use whatsoever !
I am rapidly running out of hair at this point.
I know that Direct Oracle Access components and and ODAC (from
http://www.crlab.com/home.html) use the OCI interface so I know that it can
be done. (I also know that my company won't buy these products, simply
because I am the only Builder user in the company - I work in Technical as a
DBA and get to write various utilities for our developers, Builder is my
chosen tool. The developers have to use Uniface (you don't want to know -
honest !) and VC (shame !))
I hope someone can help me out here.
Thanks in advance.
--
Norman Dunbar
Technical Specialist
Lynx Financial Systems Ltd
NDunbar@LynxFinancialSystems.co.uk
http://www.LynxFinancialSystems.com
Accept that some days you're the pigeon,
and some days you're the statue. (ANON)
Technical Details
Message-ID:
<8spqto$anp6@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,6dad97750880f454,start X-Google-Attributes: gidfcd2b,public From: "Norman Dunbar" <NDunbar@LynxFinancialSystems.co.uk> Subject: I can't get Oracle OCI calls to link Date: 2000/10/20 Message-ID: <8spqto$anp6@bornews.borland.com> X-Deja-AN: 683847251 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Lynx Financial Systems Ltd X-MSMail-Priority: Normal Reply-To: "Norman Dunbar" <NDunbar@LynxFinancialSystems.co.uk> Newsgroups: borland.public.cppbuilder.database.multi-tier