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; >logThe 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_abswhere 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\*.libIf 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.












