Microsoft KB Archive/65516

LINK @ADIS.LNK,,,LCOBOL; Generates L2041 and L2029 Errors

PSS ID Number: Q65516 Article last modified on 09-21-1990

3.00 3.00a MS-DOS

Summary: Issuing the following linker command in order to create ADIS.EXE generates one L2041 (no stack segment) error and several L2029 (unresolved external) errors: LINK @ADIS.LNK,,,LCOBOL; This is because the linker response file ADIS.LNK included with COBOL 3.00 and 3.00a has an extra “+” character after the last object module in its list (ADISKEY). Removing the extra “+” will correct the problem. This information applies to Microsoft COBOL Compiler versions 3.00 and 3.00a for MS-DOS.

More Information: According Page 4-7 of the “Microsoft COBOL Compiler 3.0: Operating Guide,” you can create ADIS.EXE (the dynamically linkable Accept/Display support file) with the following command LINK @ADIS.LNK; where “ADIS.LNK” is the linker response file included with the product. This response file lists the three ADIS support object files: ADIS, ADISINIT, and ADISKEY (all have .OBJ extensions). However, using the ADIS.LNK response file in the link line prescribed will generate one L2041 (no stack segment) error and several L2029 (unresolved external) errors. These errors occur even if the LCOBOL.LIB run-time library is mentioned in the “libraries” parameter of the linker. (The necessity of mentioning the LCOBOL.LIB library is documented in a separate article in this Knowledge Base; for more information, query in this Knowledge Base on the following words: COBOL and ADIS and LCOBOL.LIB.) These errors are caused by the fact that ADIS.LNK was not designed to be the only (or last) item in the “object modules” parameter of the linker. The default ADIS.LNK file that is installed contains the following lines ADIS + ADISINIT + ADISKEY + where each “+” character indicates that another object module will be mentioned subsequently, either immediately after the “+” or on the next line of the response file. Since a “+” follows ADISKEY, the last object module mentioned, the linker assumes that another module will follow. To avoid this problem and the linker errors that result, edit ADIS.LNK and remove the last “+” character. Therefore, the correct ADIS.LNK would be the following: ADIS + ADISINIT + ADISKEY With this ADIS.LNK response file, the link command mentioned above will correctly create ADIS.EXE.

Copyright Microsoft Corporation 1990.