Cris,
I don't see any problems with executables.
The problem is that you are trying to make Cobol module (.so) which works
with Oracle
and you didn't link cobsqlintf.o into your executable (cobcrun in your
case).
You have 3 choices:
1. Compile YOUR.cbl as executable
cobc -x YOUR.cbl $ORACLE_HOME/precomp/lib/cobsqlintf.o -L $ORACLE_HOME/lib
-lclntsh 2. Compile your module with static calls
cobc -m -fstatic-call YOUR.cbl $ORACLE_HOME/precomp/lib/cobsqlintf.o -L
$ORACLE_HOME/lib -lclntsh
3. Try to preload your module:
export COB_PRE_LOAD=YOUR
Regards,
Sergey
----- Original Message -----
Sent: Monday, May 21, 2007 5:46 PM
Subject: [open-cobol-list] Error with OC
0.33 and linking to Oracle 9i
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?
Thanks.
Cris Schlehuber
------------------------------------------------------------------------- This
SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE
version of DB2 express and take control of your XML. No limits. Just data.
Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ open-cobol-list
mailing
list address@hidden https://lists.sourceforge.net/lists/listinfo/open-cobol-list
|