Microsoft KB Archive/37402

LINK Error L4021 “No Stack Segment” Making ADIS.EXE, IXSIO.EXE

PSS ID Number: Q37402 Article last modified on 04-20-1993

3.00a | 3.00a MS-DOS | OS/2

Summary: Creating the ADIS.EXE dynamically linked Accept/Display support file can be done in one of the following two ways: 1. LINK @ADIS.LNK; 2. LINK ADIS+ADISINIT+ADISKEY;

More Information: When attempting to create the dynamic ADIS.EXE support file in COBOL Version 3.0a, these LINKing methods return with 40 LINKer errors detected, which are labeled by the following message: LINK : warning L4021: no stack segment The same behavior occurs when linking the files EXTERNL.OBJ and EXTFH.OBJ. (EXTERNL.OBJ and EXTFH.OBJ support inter-program communication and are required when using EXTERNAL files and data.) Microsoft COBOL Version 3.0a does not include the run-time library in system programs such as ADIS.OBJ, ADISINIT.OBJ, ADISKEY.OBJ, and IXSIO.OBJ. This change from COBOL Version 3.0 is documented under the heading “Dynamic Linking of System Programs” in the README.DOC included with Version 3.0a. The following are two ways to handle this change: 1. LCOBOL.LIB in the LINK step, as follows: LINK ADIS+ADISINIT+ADISKEY,,,LCOBOL.LIB; LINK IXSIO,,,LCOBOL.LIB; The following is the example for creating EXTERNL.EXE and EXTFH.EXE: LINK EXTERNL.OBJ,,,LCOBOL.LIB; LINK EXTFH.OBJ,,,LCOBOL.LIB; 2. Statically link the ADIS and/or IXSIO support files directly into your program after it has been compiled, as follows: LINK progname+ADIS+ADISINIT+ADISKEY; LINK progname+IXSIO;

Additional reference words: 3.00a Copyright Microsoft Corporation 1993.