Microsoft KB Archive/46996

= PRB: L1074 Groupname: &quot;Group Larger Than 64K Bytes&quot; Error =

Article ID: 46996

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft LINK for MS-DOS 4.x
 * Microsoft LINK for MS-DOS 5.03
 * Microsoft LINK for MS-DOS 5.05
 * Microsoft LINK for MS-DOS 5.1
 * Microsoft LINK for MS-DOS 5.11
 * Microsoft LINK for MS-DOS 5.13
 * Microsoft LINK for MS-DOS 5.15
 * Microsoft LINK for MS-DOS 5.3
 * Microsoft LINK for MS-DOS 5.31.009
 * Microsoft LINK for MS-DOS 5.5
 * Microsoft LINK for MS-DOS 5.6

-



This article was previously published under Q46996



SYMPTOMS
An attempt to link an application fails and Microsoft LINK generates the following message:

L1074 groupname: group larger than 64K bytes



CAUSE
The size of the DGROUP segment (the default data segment) exceeds 64K.



RESOLUTION
There are four methods to resolve the data segment overflow with Microsoft C and Microsoft QuickC, as follows:
 * 1) Specify a smaller value for the stack size.


 * 1) * In the QuickC environment, choose Make from the Options menu, choose Linker Flags, and choose Stack Size.
 * 2) * In the Programmer's WorkBench (PWB) environment, choose Link Options from the Options menu, then choose Stack Size.
 * 3) * On the LINK command line, specify the /ST:decnum option switch, where &quot;decnum&quot; is the size of the requested stack as a decimal number.
 * 4) * On the C command line, specify the /F hexnum option switch, where &quot;hexnum&quot; is the size of the requested stack as a hexadecimal number.
 * 5) Specify the FAR keyword for data declarations to remove the data from DGROUP.

Note: In the small and medium memory models, functions of the Microsoft run-time libraries cannot access data removed from DGROUP in this manner. The application must copy the far data to a near heap location before using a run-time library routine with this data.
 * 1) Compile the application in the compact, large, or huge memory model and specify the /GtX compiler option switch where &quot;X&quot; is the data threshold in decimal format. Any data item larger than &quot;X&quot; bytes is removed from DGROUP into a far data segment.

Note: In QuickC version 2.5 and in PWB versions 1.0 and later, it is not necessary to leave the environment. Specify the /Gt option switch in the Additional Options field for the compiler.
 * 1) Reduce the amount of data declared in the program. In an application developed for the compact, large, or huge memory models, try dynamically allocating space for the data. In the small and medium memory models, you can use _fmalloc to dynamically allocate memory outside DGROUP; however, as stated in method number 2 above, the run-time libraries do not work with this data.

Reduce the amount of string literals in the default data segment by reading strings from a data file at run time, or, in C version 5.0, by specifying the /Gt option switch to move string literals form the _CONST segment in DGROUP into a far segment.

Additional query words: 2.50 4.10 5.00 5.10 5.30 5.50 5.60

Keywords: kb16bitonly KB46996

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.