PRB: L2061 Error on _TEXT Segment in Large Memory Model App

Last reviewed: August 8, 1997
Article ID: Q133072
The information in this article applies to:
  • Microsoft Visual C++ for Windows, versions 1.0, 1.5, 1.51, 1.52

SYMPTOMS

When building a large application with the large or huge memory model, the Visual 16-bit C++ linker reports an L2061 error and displays this message:

   no space for data block associated with <function> inside segment _TEXT

Here <function> is the (possibly decorated) name of a C/C++ run-time function.

CAUSE

This can occur when building very large applications that call a large number of run-time library functions. The run-time library puts all its code in the _TEXT segment. If an application pulls in a lot of code from the run-time library, because of calling many functions, the size of _TEXT will exceed 64K, which is the maximum size of a segment.

This can also occur in large mixed-language programs using Visual C++ and Microsoft Fortran. The Fortran run-time functions are also placed in _TEXT.

RESOLUTION

To resolve this behavior, do one of the following:

  • Reduce the number of C/C++ run-time functions the application calls.

    -or-

  • If you are building a Windows-based .EXE, split the application up so that some functionality is provided by one or more DLLs. This way you can continue to use the same run-time functions, but all the code would not exist in one module.

STATUS

This behavior is by design.


Additional query words: 5.5 5.6 5.50 5.60 5.60.339
Keywords : CRTIss kb16bitonly LinkIss
Version : 1.0 1.5 1.51 1.52
Platform : WINDOWS
Issue type : kbprb


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.

Last reviewed: August 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.