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

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 : kb16bitonly kbCRT kbVC
Issue type : kbprb
Technology : kbVCsearch kbAudDeveloper kbvc150 kbvc100 kbVC151 kbVC152


Last Reviewed: May 6, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.