gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

static linking (Re: COB_PRE_LOAD)


From: Simon Sobisch
Subject: static linking (Re: COB_PRE_LOAD)
Date: Tue, 19 May 2020 12:47:08 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Am 19.05.2020 um 01:27 schrieb James K. Lowden:
> Is there a static alternative to COB_PRE_LOAD?
>
> I would like to compile my Cobol program, linked to Cobol libraries,
> without relying on any runtime configuration.
>
> [...]
>
> i would like the user to use the program without requiring runtime
> configuration that is simply a by-product of the fact that the program
> was written in Cobol.
>
> --jkl
>

The common way to link COBOL to COBOL is to use statically linking and
only produce one executable. This *should* be covered in the GnuCOBOL
manual.

Either something like
   cobc -static bar.cob foo.cob

or (likely more reasonable with bigger environments using make)
something like the following

all: foobar

SUFFIXES = .cob .$(COB_OBJECT_EXT)
FOOBAR_OBJECTS = foo.$(COB_OBJECT_EXT) bar.$(COB_OBJECT_EXT)

.cob.$(COB_OBJECT_EXT):
   cobc -static -c $<
foobar: $(FOOBAR_OBJECTS)
   cobc -static $(FOOBAR_OBJECTS) $<

Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]