[open-cobol-list] Error with OC 0.33 and linking to Oracle 9i
From:
schlehuberc
Subject:
[open-cobol-list] Error with OC 0.33 and linking to Oracle 9i
Date:
Mon, 21 May 2007 16:46:03 -0500
I am working to get OC 0.33 (downloaded
on 5/9/07) up and running on an AIX 5.2 64-bit machine.
I have been following the various suggestions
for linking to the Oracle libraries. I have tried two different methods.
First, I tried using the make file provided
by Oracle (this was a suggestion recently posted on the OC forum).
It keeps erroring with undefined symbols.
I believe this is occurring because the make is not getting the libclntsh.a
linked in correctly.
Second, I tried doing a cobc -cm to
create the .o module, and then do a separate link call to include the libclntsh.a
and cobsqlintf.o files.
When I tried to do a cobcrun, it keeps
coming back with the following error: "libcob:
Cannot find module 'SQLADR'"
I added a -save-temps flag to the cobc,
and looked at the c source code.
The call to SQLADR is being made by
cob_resolve_1.
If I am following the libcob code correctly,
it is trying to make a dlopen call, and would be looking for a SQLADR.so
module.
The actual function is included in cobsqlintf.o
(which gets included in on the link step), so there is no .so module to
use.
I was brave, and went in a modified
the c code to directly call SQLADR instead of going through cob_resolve_1.
Doing this, the program was able to
make a connection to the Oracle DB, and successfully execute a FETCH of
a cursor.
Original code created by cobc
func = cob_resolve_1 ((const char *)"SQLADR");
(*(int *) (b_1)) = func (b_47, b_9
+ 32);
Modified coded
(*(int *) (b_1)) = SQLADR (b_47, b_9
+ 32);
There have been posts from others indicating
that they have the calls to Oracle working without this modification.
Is there something that I am missing?