[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] calling std c library calls from cobol and cob_ins
From: |
Keisuke Nishida |
Subject: |
Re: [open-cobol-list] calling std c library calls from cobol and cob_inspect_tallying() segmentation violation |
Date: |
Tue Jun 4 18:50:12 2002 |
User-agent: |
Wanderlust/2.6.0 (Twist And Shout) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (UnebigoryĆmae) APEL/10.3 Emacs/21.2 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Tue, 04 Jun 2002 09:31:03 -0600,
Richard A. Painter <address@hidden> wrote:
>
> 1. i want to use static linking however, when i try to use -static
> cobc complains telling me i must use -m since i use CALL USING. is
> this true that dynamic linking MUST be used if one uses CALL USING?
No. The compiler shows the warning when you use
PROCEDURE DIVISION USING, not CALL USING. All the `-m' option
implies is that the program does not have main() function.
It should be independent of the -static/-dynamic options.
> 2. how does one call a standard c library call from a cobol program?
> this is not addressed in the online docs. does this change when using
> static or dynamic linking?
Static linking should work. The following program works for me:
---- sample.cob ----------------
IDENTIFICATION DIVISION.
PROGRAM-ID. sample.
PROCEDURE DIVISION.
CALL "pause".
--------------------------------
% cobc C -m -static sample.cob
generates a C output
cob_return_code = pause ();