PRB: L1074 Groupname: Group Larger Than 64K Bytes

ID Number: Q46996

4.06 4.07 4.10 5.01 5.02 5.03 5.05 5.10 5.11 5.13 5.15

MS-DOS

Summary:

SYMPTOMS

If the size of DGROUP (the default data segment) exceeds 64K, the

following linker error message is given:

L1074 groupname: group larger than 64K bytes

CAUSE

This error is documented in the "Microsoft QuickC Compiler Tool

Kit" manual as follows:

The given group exceeds the limit of 65,536 bytes.

Reduce the size of the group, or remove any unneeded segments from

the group (refer to the map file for a listing of segments).

This error is also documented in the QuickHelp files shipped with

Microsoft C and MASM.

RESOLUTION

There are four ways to resolve this data segment overflow when using

C or QuickC:

1. Reduce the stack size in order to reduce the size of DGROUP.

From within the QuickC environment, this can be done by choosing

Make from the Options menu, choosing Linker Flags, and then

selecting Stack Size.

From within the Programmer's WorkBench (PWB), choose Link

Options from the Options menu, then select Stack Size.

This may also be done on the LINK command line with the

/ST:decnum switch, where decnum is the size of the requested

stack in decimal format.

At compile time, the /F hexnum switch may be used on the command

line. Hexnum is the size of the requested stack in hexadecimal

format.

2. Declare data with the FAR keyword to move it out of DGROUP.

Note: In the small and medium memory models, the Microsoft

run-time library functions can no longer be used with this data.

You must copy this far to a near heap location, before you use

the run-time routines on this data.

3. From the command line, compile in the compact, large, or huge

memory model with the "/GtX" switch, where X is a data threshold.

All data items larger than X bytes are moved out of DGROUP into a

far data segment.

Note: In QuickC version 2.5 and in PWB 1.0, there is no need to

exit the environment. The /Gt switch may be specified in the

Additional options field for the compiler.

4. Reduce the amount of data declared in the program. In the

compact, large, and huge memory models, try dynamically

allocating space for the data. Memory can also be dynamically

allocated outside DGROUP in the small and medium memory models

by using _fmalloc(); however, as stated in method number 2

above, the run-time library functions do not work with this

data.

Reduce the amount of string literals in this default data

segment by reading from a data file at run time, or in C 5.0, by

using the /Gt patch to allow string literals to be moved from

the _CONST segment in DGROUP into a far segment.

Additional reference words: 2.50 4.06 4.07 4.10 5.00 5.01 5.02 5.03

5.10 5.11 5.13 5.15 6.00