Oracle, Cobol, and Unix libraries

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 29 Jun 1993 08:47:29 -0500
Message-ID: <C9Dy5K.zI_at_uk.ac.brookes>


I hope someone can help me...
We're using Oracle Forms, and want to call routines written in Cobol. The cobol compiler we're using is acucobol/85.

As far as I can make out, this could work fine[*] using C to glue the two pieces together:
  Forms calls a C function, which then sorts out it's parameters and calls a cobol routine.

Except, that when I try a standalone C program to call cobol, I get a link error, telling me that main is defined twice. It is: once in my C program, and once in the runtime cobol library.

Having talked to acucobol, they suggest: 1) I rename my main() to something else... Great idea! Now how do I execute the program :-?
2) I write a really simple cobol program which calls a C program, which calls a cobol routine. Blech.

I presume the Forms routines that I would be linking in actual use also have their own main(), which stops method 1. Alternatively, I write a simple cobol program which calls a C program which calls Forms, which calls C, which calls cobol. BLEEEECHHHH :-(

Alternatively, I rename the acucobol main function. Can anyone tell me how to do this? It's stored in an ar type library, in an object file called main.o, which also contains global variable definitions, so I can't simply delete the object file from the library.

Or, has anybody else used acucobol and Oracle together? When we bought the compiler, we were told that it worked with Oracle. Strange bl**dy definition of working.

[*] Works fine means linking a 600k library to an executable that's already 2.5Mbyte in size. And then gluing the two together with C. Maybe. I dunno, cos I ain't got that far. :-(

--
  _________________________   _________________________________________
 /  Tommy Wareing          \ /  And I dream of movies                  \
|  p0070621_at_uk.ac.brookes   X   They won't make about me when I'm dead  |
 \  0865-483389            / \      - Jon Bon Jovi, Keep the Faith     /
  ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Tue Jun 29 1993 - 15:47:29 CEST

Original text of this message