digitalmars.com                        
Last update Sun Mar 4 11:58:07 2018

OPTLINK Error Messages

This lists warnings, plus non-fatal and fatal error messages generated by OPTLINK. When appropriate, any probable cause and/or remedy is briefly discussed. The DOS return code and segmented .exe error flag is set upon OPTLINK encountering either a Non-Fatal or Fatal error. Warnings have no effect on the code or flag. See also /ONERROR and /DELEXECUTABLE.

Each warning and error message, with added information such as the symbol name or file name involved, is displayed to stdout and added to the .map file (if selected) when its triggering condition is detected. To create a log of errors, command line redirection may be used:

link foo; >log
The following rules apply when displayed: If the file name is known, it is printed. If the module name is known, it is printed (useful especially if the file name is .lib). If the error occurs at a known offset in the file, the offset (in hexadecimal) is printed. If a specific object record is being worked on, its record type (a number in hex corresponding to the standard Intel OMF or some extension) is printed. And in every case, an error number (not significant since these numbers may vary between OPTLINK versions and/or other linkers) is printed followed by the text.

Warning Messages

Warnings alert the operator to an inconsistency rather than diagnosing a known error. These messages indicate code that may not execute as expected but does link. OPTLINK completes its operation and the output file may be usable.
ALIAS Previously Defined
An attempt to alias an already-defined symbol was detected. The ALIAS directive is ignored.
Bad Checksum
A checksum error was detected in an input file. Perhaps the file has been corrupted.
Below 100H Cannot Be Initialized
While creating a .com file, an attempt to initialize data areas at an address lower than 0100h was detected.
Cannot Allocate EMS Blocks
An EMS allocation call failed. The EMS driver has provided inconsistent information. OPTLINK will use alternative memory space instead.
Cannot Generate Segmented .COM or .SYS File
A .com or .sys extension was specified as the output file name when a .def file had also been supplied.
COMMON Combine type overrides others
Multiple combine types were specified for a given named segment. In such a conflict, the COMMON combine type overrides all others, and the multiple segments will be combined into a single segment.
Duplicate RESOURCE
Ignored, A second resource was found within the .res file with the same name and type as one already processed. The second resource is ignored.
File Not Found
The specified .lib file could not be found in order to complete command operations. If referring to an .obj file or an indirect command file, this indicates a fatal error, described later in the fatal error section.
Heap without DGROUP
Heapsize was defined with no DGROUP or zero length DGROUP. Causes Windows to crash.
Grouped Segments Have Conflicting Flags
Segments in a single group have different flag settings declared via the SEGMENTS directive in the .def file. Since a group is a single physical segment in protected mode, all segments that make up the group must have the same flags.

This warning may be caused by the fact that any non-default flags override the default settings. That is, a MOVABLE segment overrides a FIXED segment, and the whole group becomes MOVABLE.

LINNUMs in Non-CODE Segment
A LINNUM statement was encountered within a data segment.
Missing LIBRARY in .DEF File for .DLL
A .dll extension was specified for the output file, but no LIBRARY directive appears in the .def file. The .dll is created with default assumptions.
No Stack
No stack segment was supplied. If a .com or .sys file is being generated, it is normal; in other cases, be careful.
No Start Address
The end of the last .obj file was reached and start address was not detected. In assembler programming, start addresses are specified by putting a label after the END statement. In high level languages, perhaps the start up modules were not supplied. In C and C++ programs, this typically means that the program has no main(), wmain(), WinMain(), DllMain(), or LibMain().
Segment Already in Different Group
OPTLINK detected a second attempt to assign a segment to a group. Each segment can belong to only one group.
Stack Already Declared in Module
OPTLINK detected a second attempt to define a stack segment. Each program can have only one stack segment. The warning is followed by the name of the module that first declared a stack.
STACK Combine type overrides others
Multiple combine types were specified for a given named segment. In such a conflict, the STACK combine type overrides all others, and the multiple segments will be combined into a single segment.
Start Previously Specified in Module
More than one start address was specified for a program. Start addresses are specified by putting a label after the END statement. Only one module should specify a start address. If OPTLINK finds more than one, it uses the first one encountered.
Symbol in this LIB defined elsewhere
Warning message generated from /WARNDUPS.
Too Many Segments
Trying PACKCODE, The segmented .exe format can hold only 254 segments. This warning appears when more than 254 segments exist and /PACKCODE was not specified. OPTLINK automatically invokes /PACKCODE in an attempt to reduce the segment count to a number below 255.
Too Many Segments
Trying PACKDATA, The segmented .exe format can hold only 254 segments. This warning appears when more than 254 segments exist after OPTLINK attempted to /PACKCODE, and /PACKDATA was not specified. OPTLINK automatically invokes /PACKDATA in an attempt to reduce the segment count to a number below 255.
Unknown Option
OPTLINK encountered a misspelled, incomplete, or unsupported option switch.
Unsupported GRPDEF Type
An invalid GRPDEF record was encountered. The bad record is ignored.

Non-Fatal Error Messages

These are errors which may make the output file unusable, but did not prevent OPTLINK from completing successfully. Processing continues if any of these errors are detected, but the output file that is generated should not be used.
.EXE Header > 64k
The resident portion of a .dll or .exe header approaches or exceeds 64Kb. Windows loads this header into a single segment; therefore, it must be smaller than 64Kb. The sizes of the various pieces that make up the header are listed. You probably need to import/export by ordinal to reduce name table sizes.
Bad COMDEF Sizes
An size error was detected in a COMDEF record.
Badly Formed Segment Size
The BIG bit was set and segment size was not zero.
BYTE Out of Range
Code such as:
    mov al, ext_abs
where ext_abs is greater than 255, was encountered.
Cannot Export
Symbol cannot be exported. It may be either undefined or a constant. Symbols must have an associated segment to be exported.
Cannot Reach TARGET from FRAME
A traditional "fixup overflow" was detected by OPTLINK. Usually caused by: memory-model conflicts, a segment or group being too large, segment order or combining errors (look at the map file output to diagnose this), incorrect ASSUME statements, trying to access a variable when no segment register points to it, or trying to do a NEAR CALL / NEAR JMP to a FAR routine.
CEXTDEF With No COMDAT
The end of an object file was reached and a CEXTDEF item remains unresolved.
COMDAT Continuation Mismatch
A COMDAT continuation record appears before the COMDAT definition to which it refers. If you get this error, please contact Digital Mars Technical Support.
COMDAT Syntax
Due to either corrupt files, translator errors, internal errors in OPTLINK, or unknown enhancements to the OMF conventions. If you get this error, please contact Digital Mars Technical Support.
Constants Must Have FRAME=0
A constant having a FRAME value other than zero was detected. While not prohibited in Intel's OMF format, this is not valid in the Microsoft version.
CODE Directive
A syntax error was detected in a CODE directive.
DATA Directive
A syntax error was detected in a DATA directive.
Data Outside Segment Bounds
OPTLINK found more data in an object module than expected. For example, an object file that indicates 5 bytes of data are to follow, and then provides 6, will cause this error. Most likely cause is that the object file has been corrupted, or that a translator error has occurred.
Data Overlaps Relocations
Displayed while the /RELOCATIONCHECK option was in effect and an overlap was detected. Probable causes include initialization of the COMMON segment in more than one module, use of the ORG statement to back up over existing code, or a translator error. The problem must be resolved, or all other addresses referenced in the output file may be wrong since relocation information is often stored as in-place linked lists.
Delimited String Expected
OPTLINK failed to find a delimited string required by the directive syntax being parsed.
DGROUP + Stack + Heap Exceeds 64K - 16
The total sizes of Heap, Stack, and DGROUP exceed 65,520 bytes. Try reducing the size of the stack or the heap, or use /HEAPSIZE MAXVAL.
Duplicate OLD
A second OLD directive was encountered.
Duplicate ORDINAL Number
The ordinal number specified for this symbol was already specified for use by another symbol. Two exported symbols cannot have the same ordinal number.
Duplicate RC Commands
Both the RC directive in the .def file and the /RC option switch were supplied. Eliminate one of the two to correct the error.
Duplicate STUB
A second STUB directive was encountered.
EXETYPE Directive
A syntax error was detected in an EXETYPE directive.
EXPORTS Directive
A syntax error was detected in an EXPORTS directive.
_Export Conflicts With EXPORTS
OPTLINK detected a symbol with a different name or parameter list size in the .def file than was present in the .obj file. They should agree.
FIXUPP Points Past Data Record
OPTLINK detected a situation such as a FIXUPP record instructing that the doubleword beginning at byte 5 of a data record be changed, when the data record contains only six bytes (since a doubleword beginning at byte 5 would extend through byte 8). Most likely, the .obj file has been corrupted or a translator error occurred.
GROUP Cannot Be Both Relocatable and Absolute
A segment defined as SEGMENT AT was placed within a GROUP with a normal relocatable segment.
Group Cannot Contain CODE and DATA Segments
Segments in the same group have different type flag settings, via the SEGMENTS directive in the .def file or their class names. Since a group is a single physical segment in protected mode, the type for the whole group must be either code or data. It cannot contain both types.
Group Size Exceeds 64k
The total size of all segments named within a Group exceeds 65,536 bytes.
Groups Overlap
An overlap of groups was detected. In protected mode, groups are logical segments, and cannot be permitted to overlap. To reorder segments in such a way that the overlap is eliminated, use /REORDERSEGMENTS.
HEAPSIZE Directive
A syntax error was detected in a HEAPSIZE directive.
Illegal Frame On Start Address
Detected a FIXUPP error on the start address. Check the module defining the start address.
Illegal Start Address
An absolute address was used as a start address in relocatable mode. Correct the address.
IMPORT Illegal As Start Address
The start address was specified as a symbol imported from another library. This is illegal. The start address must be in the .exe, not in a .dll.
IMPORTS Directive
A syntax error was detected in a IMPORTS directive.
LOCATION Not Within FRAME
A CALL or JMP was made and the CS ASSUME is not valid.
Library Error
A library problem was detected. The most likely cause is a corrupted library dictionary.
LINSYM Before COMDAT
A LINSYM record points to a non-existent COMDAT record. Most likely, caused by either an invalid forward reference or a translator error.
Multiple Descriptions
More than one DESCRIPTION directive was encountered in a .def file.
Only One NAME or LIBRARY Allowed
More than one NAME or LIBRARY directive was detected in a .def file.
Preload Segment + Relocs > 64k
Use -k, A segment marked for preloading, plus its relocation information, exceeds 65, 536 bytes in size. The fast-load section of a Windows .exe file cannot accept segments larger than this. You can change the segment to movable, discardable, loadoncall, or disable segment sorting with -k.
Previous Definition Different
This appears as messages of the form:
SNN.lib(except)  Offset 0791FH Record Type 00C3 Error 1:
Previous Definition Different : ??1exception@std@@UAE@XZ
(syscall std::exception::~exception(void ))
It happens when a PUBLIC symbol appears more than once in the .obj and .lib files presented to optlink, in other words, the symbol is multiply defined. Multiple definitions of a PUBLIC symbol are an error because the linker cannot determine which one should be used. To find it, use grep to determine which files contain it:
grep ??1exception@std@@UAE@XZ *.obj *.lib \dm\lib\*.lib
If it is in a .obj file, use obj2asm to see if it is a PUBLIC definition or not. If it is in a library (.lib) file, use lib to generate a .lst file and see which modules in the library define the symbol. Once it is clear where the multiple definitions are coming from, it's possible to figure out why and what to do about it.
PROT vs REAL Conflict
A conflict between real mode and protected mode syntax was encountered.
PUBDEF Must Have Segment Index
OPTLINK encountered a PUBLIC symbol that had no reference into a defined SEGMENT. Most likely cause is a corrupt object file, due either to a disk accident or translator error.
Relocatable Bases Not Allowed in Absolute Mode
Reference to relocatable data was encountered while processing code in Absolute Mode. That is, the .obj module(s) cannot reference segments or groups, cannot do far jumps or calls, and cannot do DD LABEL, when generating a .com or .sys file, unless the target segment has been declared to be absolute (SEGMENT AT).
Segment >= 4G
The total size of a 32-bit segment exceeds 4 gigabytes ("4G").
Segment Size Exceeds 64k
The total size of a segment exceeds 65, 536 bytes ("64K").
SEGMENTS Directive
A syntax error was detected in a SEGMENTS directive.
Short JMP Out of Range
The destination of short JMP instruction was more than 125 bytes from the location of the instruction.
Start Address Must Be 100H
The .com file option has been selected and a starting address (END start_addr) other than 0100h was also specified.
Symbol Undefined
A symbol remained undefined after all input files, including libraries, had been processed. Common causes for this are:
  • A function was called in your code, but the function was never written.
  • A virtual function was declared, but never written.
  • A data variable was referenced, but never defined anywhere.
  • Did not specify all the .obj files to the linker.
  • The calling conventions of the function being referenced do not match the calling conventions of the defined function. Compiler switches, memory models, and special keywords can all affect calling convention (and thereby the name of the symbol as it appears in the .obj file).
  • One or more missing library files (.lib). One way to figure out which .lib file contains the missing symbol is to run:
    \dm\bin\grep symbolname \dm\lib\*.*
    
  • The LIB environment variable is missing or not pointing to the \dm\lib directory or wherever the .lib files reside.
Too Many ENTRIES
More than 65,536 entries were specified.
Too Much DEBUG Data for Old CodeView Format
OPTLINK detected more than 64KB of debug information per type per module, and the CodeView option has been enabled for a CodeView version prior to 4.0.
Unknown COMDAT Allocation Type
Either corrupt files, translator errors, internal errors in OPTLINK, or unknown enhancements to the OMF conventions. If you get this error, please contact Digital Mars Technical Support.
Unrecognized data in .CFG
Syntax error within optlinks.cfg.
Unrecognized FIXUPP Type
Most likely cause is the object file has been corrupted, or a translator error has occurred.
Unrecognized Record
A record in an object file cannot be recognized as one of the defined record types. The unrecognized record is skipped and linking continues.
Weak EXTRN Different
A "weak EXTERN" declared with a different default in another module was encountered.
WeakLazyAlias Internal
A specific internal error condition was detected in OPTLINK. If you get this error, please contact Digital Mars Technical Support.

Fatal Error Messages

These prevent a successful completion of OPTLINK, processing stops immediately upon detection. An executable or possibly a partial executable may have been created. This file is unusable and should be deleted.
.DEF Syntax Error
An invalid .def file syntax could not be parsed.
.RES File Corrupt
The compiled resource (.res) file was found to be corrupt. To correct it, rebuild the file using the rc.exe resource compiler and its /r option switch.
APPLOAD Must Appear Before Any Segments
A segment precedes the APPLOADER directive in a .def file.
Bad FIXUPP Thread
A FIXUPP thread was referenced prior to being defined. The .obj file is corrupt and must be regenerated. This condition can only be caused by a translator error.
Bad LOC Frame in Start Address
An undefined FIXUPP frame was referenced in a start address. The object file is corrupt and must be regenerated. This condition can only be caused by a translator error.
Bad OMF Extension
The format of a type A0 COMENT record cannot be recognized.
Bad STUB File
An error was detected while parsing the specified STUB file. Indicates an invalid DOS .exe file.
Cannot Create File
A requested output file cannot be created. Most probable causes are the requested file name contains an invalid character, or the output disk directory is full (applicable only to root directories).
Cannot parse Class record
Corrupt debug information.
Cannot Reopen Output File
A file access error was encountered, probably due to a sharing violation on the output file.
Circular ALIAS
A chain of aliases references itself.
Colon Expected
An OPTLINK option that requires a number is requested, and the ":" or following number is not given. Try the operation again, being sure to supply all required numbers.
Dictionary Exceeded 512k
Library dictionaries have a size limit of 512Kb, which is unlikely to ever be reached unless the /IMPLIB switch is used incorrectly.
Disk Full Writing
OPTLINK failed to find enough space on the disk to write the required output (or virtual memory) file.
DOS Critical Error
DOS detects a "critical error" while processing a read or write function for OPTLINK.
DOSSETFILEINFO Error
An OS/2 critical error occurred.
EMS Error
OPTLINK was notified of an EMS error while attempting to access expanded memory. The only known causes for this error are faults in either the EMS driver or the EMS hardware.
EXPORTed Names Text >64k
The exported names text exceeds the limit. Try using the /NONAMES link option.
Filename Expected
OPTLINK failed to encounter a required file name as input.
File Not Found
Commands were given to perform an operation with a object file which cannot be found.
Illegal Filename
A file name cannot be parsed into a valid format.
Illegal Record Syntax
OPTLINK was unable to decipher the syntax of a record in an object file. The most likely cause is that the object file is corrupt, due either to a disk accident or to a translator error.
/IMPLIB Needs Larger /PAGESIZE
Set the /PAGESIZE link option to a larger number.
Incremental Compile Error
A record was detected that says the .obj file being processed is corrupt. Compilers such as Microsoft Quick C may create such records upon detecting certain errors during an incremental compile.
Index Range
A record in the object file provides an index value which is outside the allowable range of values. The most likely cause is that the object file is corrupt, due either to a disk accident or to a translator error.
Indirect File Nested Too Deep
The nesting level for indirect files exceeds 10.
Limit of 65535 Base FIXUPPs Exceeded
Attempted to created more than 65,535 relocation entries for a real-mode executable. This limit is imposed by the structure of the .exe file.
Module or Dictionary Corrupt
When attempting to read a .obj or .lib module, the first record was invalid. This error can be caused by passing some other file mistakenly as a .obj or .lib (syntax error). It also can be caused by invalid library dictionaries built by incompatible tools.
Need Larger /ALIGNMENT Value
The segmented (Windows or OS/2) executable is larger than 64KB * ALIGNMENT. Alignment is the page boundary in the .exe or .dll on which all segments will start. These segments are referred to elsewhere by a 16-bit page number. OPTLINK defaults to an ALIGNMENT of 16 (limits an executable to 1MB) to reduce wasted space between segments, while other linkers normally waste space by defaulting 512. To fix the problem, increase the /ALIGNMENT size.
No Segments Linked!
No input files could be processed. Therefore, no file could be created.
Not a Valid Library File
A .lib file fails to meet the criteria for .lib files.
Number Overflow
A number greater than 65,535 (16 bits) was supplied on the command line.
OBJ Record Too Long
An object record exceeds 6000 bytes in length. The .obj or .lib file is probably corrupt.
Out of Memory
OPTLINK does not have enough memory to continue operation. OPTLINK needs to have a minimum of 200KB available. Try removing a TSR or two, and link again, or (if you are using a makefile) link from outside the MAKE program.
Overflow 32-bit Multiply
OPTLINK's far global data allocation routines encounter an address value which they cannot successfully calculate. While it is documented here for completeness, you are not likely to see this message.
Selector Already Released
As a result of an internal processing error within OPTLINK. If you get this error, please contact Digital Mars Technical Support.
Swap File Full
Virtual memory is exhausted. Delete any unnecessary files from your disk and try again.
Token Too Long
A symbol name or other token exceeds the 468-character limit. The .obj or .lib file is probably corrupt. The too-long symbol is appended to the message.
Too Many Relocs to EXEPACK
More than 8,191 segment relocations per 64KB of data were involved while performing EXEPACK on real-mode executable.
Too Many Segments For Segmented .EXE Format
The segmented .exe format can hold only 254 segments. Number of segments has been exceeded, even after /PACKCODE and /PACKDATA have been used. Try using .dll's to contain some segments and thus reduce the size of this module.
Too Much EXESTR Data
More than one megabyte of EXESTR data (created by a MSC6.0 pragma) exists. OPTLINK supports up to one megabyte of EXESTR data.
Unexpected End of File
OPTLINK encountered the end of an input file before finding a MODEND record. The most likely cause is that the object file is corrupt, due either to a disk accident or to a translator bug.
Unknown FIXUPP Frame Type
OPTLINK was unable to determine the frame type of a FIXUPP record in an object module. Most likely cause is that the object file has been corrupted, or that a translator error has occurred.
Unrecognized B2 Record
OPTLINK found a type B2 record in its input files and was unable to determine the meaning of the record. Most likely cause is that the translator has added an undocumented extension to the B2 record usage.
Unrecognized Communal Syntax
OPTLINK detected an error while processing a type B0 (Communal Data) record.
Unrecognized Record
OPTLINK cannot recognize the type of a record in an object file.
User ABORT
The user pressed Control-C or Control-Break to abort the link operation.
XMS Error
OPTLINK was notified of an XMS error while attempting to access extended memory. The only known causes for this error are faults in the XMS driver.
Home | Runtime Library | IDDE Reference | STL | Search | Download | Forums