"Too Many Segments" LINKing More than 128 Modules (45165)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft Basic Professional Development System for MS-DOS 7.0
- Microsoft Basic Professional Development System for MS-DOS 7.1
This article was previously published under Q45165 SUMMARY
The linker error message L1049, "Too many segments," occurs when you
are trying to LINK more than 128 modules into an .EXE program or a
Quick library. The default number of segments for LINK.EXE is 128. To
correct this problem, combine two or more of the modules (the .BAS
source files).
If the modules are too large to combine, you must set the number of
segments to more than 128 with the /SEGMENTS linker option. While
/SEGMENTS:3072 is the highest allowed value in the LINK syntax, the
true practical limit is about 1300 to 1500. If you compile and link
within the QuickBasic environment instead of from the DOS command
prompt, you can set the /SEGMENTS option by including the following
line in your AUTOEXEC.BAT file:
set link=/segments:<number of segments>
Note that there is no space before or after the = (equal sign). (If
this fails, add one space after the equal sign.)
This information applies to Microsoft QuickBasic versions 4.0, 4.0b,
and 4.5; to Microsoft Basic Compiler versions 6.0 and 6.0b; and to
Microsoft Basic Professional Development System (PDS) versions 7.0 and
7.1.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB45165 |
---|
|