Path: utzoo!attcan!uunet!husc6!purdue!i.cc.purdue.edu!ahk
From: ahk@i.cc.purdue.edu (Louis Lang)
Newsgroups: comp.sys.ibm.pc
Subject: Help needed on LINKing
Keywords: LINK, C, COBOL
Message-ID: <2783@i.cc.purdue.edu>
Date: 27 Jun 88 14:29:59 GMT
Reply-To: ahk@i.cc.purdue.edu (Louis Lang)
Distribution: na
Organization: Purdue University
Lines: 29

Help!! I'm trying to link an IBM COBOL/2 main program with some IBM C/2
subroutines.  (Before all you COBOL haters leave, please read on.)  My
problem occurs because there is no C-type main() function defined.  The
COBOL program is the main routine.  After LINKing the program, LINK
returns with "_main" as undefined, the .EXE file is useless (I mean, 
ALT-CTRL-DEL to restart), and I'm at the end of my rope.  I've read
(and read and read) the documentation about calling non-COBOL routines,
that part seems to be OK.  How do I tell LINK that I don't expect a
"main()" routine, and the COBOL prog should be given control?  

I've tried:
main()
{
}

and:
main()
{
   COBOL_ENTRY_POINT();   /* I forget the real name */ 
   }

The external gets defined (of course), but the .EXE file still hangs the
system.  (The latter one required a power-off to reset the machine.)
Any help will be greatly appreciated.  Thanks.

-- 
Louis Lang   LANG@PURCCVM.BITNET or lang@vm.cc.purdue.edu
             also: ahk@{choose 1: h,i,j,k}.cc.purdue.edu
Local VM Systems Guru