Informix Error -1337: The variable name has been redefined with a different type or length.
Cause and resolution
The variable name has been redefined with a different type or length.
The variable that is shown is defined in the GLOBALS section of two or more modules, but it is defined differently in some modules than in others. Possibly modules were compiled at different times, with some change to the common GLOBALS file between. Possibly the variable is declared as a module variable in some module that does not include the GLOBALS file.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1337 fires when a variable declared in the GLOBALS section is defined inconsistently across
modules — different type or length — per the official guidance, common causes include modules
compiled at different times after the GLOBALS file changed, or a variable independently
declared at module level in a file that doesn't actually include the shared GLOBALS file.
- Modules compiled at different times relative to a
GLOBALSfile change, per the official guidance — some modules reflect the old definition, others the new one. - A module declaring the variable at module level instead of including the shared
GLOBALSfile, per the official guidance — creating a second, independent (and possibly inconsistent) definition.
Solutions / Resolution
- Recompile all modules together after any
GLOBALSfile change, ensuring every module sees the same, current definition. - Confirm every module that uses the variable actually includes the shared
GLOBALSfile, rather than declaring its own local copy.
Examples
A module with its own conflicting declaration
-- globals.4gl:
GLOBALS
DEFINE g_status CHAR(10);
END GLOBALS
-- module_b.4gl (missing the GLOBALS include):
DEFINE g_status CHAR(20);
-- -1337: g_status redefined with a different length than globals.4gl
Corrected
-- module_b.4gl:
GLOBALS "globals.4gl"
Diagnostic Checks
- Check every module referencing the variable for whether it includes the shared
GLOBALSfile, or declares its own conflicting definition. - Recompile all modules together if a
GLOBALSfile change is suspected.
Related Errors / Related Topics
- -1318 — "A parameter count mismatch has occurred between the calling function and the called function." A related cross-module consistency error, about function signatures rather than global variable definitions.
A GLOBALS variable has inconsistent type/length across modules — recompile together, and check
for a module missing the shared GLOBALS include.