DOCUMENT:Q46996  30-OCT-1999  [utilities]
TITLE   :PRB: L1074 Groupname: "Group Larger Than 64K Bytes" Error
PRODUCT :Microsoft Programming Utilities
PROD/VER:MS-DOS:4.x,5.01,5.02,5.03,5.05,5.1,5.11,5.13,5.15,5.3,5.31.009,5.5,5.6
OPER/SYS:
KEYWORDS:kb16bitonly

======================================================================
-------------------------------------------------------------------------------
The information in this article applies to:

 - Microsoft LINK for MS-DOS, versions 4.x, 5.01, 5.02, 5.03, 5.05, 5.1, 5.11, 5.13, 5.15, 5.3, 5.31.009, 5.5, 5.6 
-------------------------------------------------------------------------------

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.

    - In the QuickC environment, choose Make from the Options menu, choose
      Linker Flags, and choose Stack Size.

    - In the Programmer's WorkBench (PWB) environment, choose Link Options from
      the Options menu, then choose Stack Size.

    - On the LINK command line, specify the /ST:decnum option switch, where
      "decnum" is the size of the requested stack as a decimal number.

    - On the C command line, specify the /F hexnum option switch, where "hexnum"
      is the size of the requested stack as a hexadecimal number.

2. 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.

3. Compile the application in the compact, large, or huge memory model and
   specify the /GtX compiler option switch where "X" is the data threshold in
   decimal format. Any data item larger than "X" 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.

4. 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 
Technology        : kbAudDeveloper kbZNotKeyword3 kbLINKSearch kbLINK4xDOSSearch kbLINK503DOS kbLINK510DOS kbLINK511DOS kbLINK513DOS kbLINK515DOS kbLINK530DOS kbLINK53109DOS kbLINK550DOS kbLINK560DOS kbLINK505DOS
Version           : MS-DOS:4.x,5.01,5.02,5.03,5.05,5.1,5.11,5.13,5.15,5.3,5.31.009,5.5,5.6

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1999.