The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

Compiler errors overview

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 20:16, 6 September 2010 by Eliot (Talk | contribs) (Other errors: CorrectWrong demo)

Jump to: navigation, search


Preprocessor errors

Main article: preprocessor errors

A description and solution to preprocessor errors.

Subobjects errors

Main article: subobject errors

A description and solution to subobjects errors.

Interface errors

Main article: interface errors

A description and solution to interface errors.

Other errors

Error, Unexpected 'defaultproperties
This seems to occur when you have an end of multi-comment preceded by a line comment on the same line. See Compiler issues. Keep in mind that you can not specify default properties in code while using the UnrealEd internal script editor. Doing so will give you this error as well. To change the default properties of a class in UnrealEd, you need to type editdefault class=classname in the command line of the editor.
Correct and Wrong example
Error, Instance variables are only allowed at class scope (use 'local'?)
Error, 'class': Limitor 'class name' is not a class name 
Error, Calling a singular function within a singular function on the same object will always fail 
Error, Classes with config/globalconfig member variables need to specify config file. 
You used a config modifier on a variable but forgot to add the class modifier config (resulting in the default INI file for your application) or config(*name of the INI*).
Error, Cast from 'class' to 'class' will always fail 
You probably tried to cast a class to a class that is not on the same branch of class derivation, so the result would always be 'None'. You can only cast a class to one of it's parent classes.
Error, Invalid property or function call on a dynamic array 
Error, Not allowed to use 'config' with object variables 
Error, Could not load existing package file 'package path' 
Error, 'Ignores': 'Function Name' is not a function 
Error, Class 'localized' keyword is no longer required 
Self explanatory. The localized modifier was only necessary in Unreal Engine 1 games, in newer generations this is automatic implied.
Error, Bad function definition 
This happens when you define a function with an object as the return but that object does not exist.
Error, 'UTGFxHudWrapper': Bad command or expression 
Error, Unrecognized type 'class name' 
Error, Unrecognized member 'variable name' in class 'class name' 
Error, failed to find DependsOn/Implements class 'Class' while parsing 'Class
Self explanatory. However it could be that you have made a typo or that you are referencing a struct rather than a class.
Error, Script vs. class name mismatch (ClassName/FileName) 
The name in the header of your class doesn't match the name of the UC file.
Error, Unknown member 'variable' in struct 'struct
The variable is not declared. Check if you have forgot to declare it or if you have made a typo.

Replication

Error, Unrecognized variable 'variable name' name in replication definition 

Conflicts

Error, 'Function Name' conflicts with 'Function Package.Class:FunctionName' 

Bad or missing expression

Error, Bad or missing expression in parenthesis for '='
Error, Bad or missing expression in parenthesis for Following '&&'
Error, Bad or missing expression in 'If
a function in an if statement does not return a type.
Error, Bad or missing expression in Call to 'function name', parameter number 
Error, Bad or missing expression for token: 'function', in 'Return
Error, Bad or missing expression for token: 'variable', in 'If
To note in this case the variable was an actor reference.
Error, Bad or missing expression for token: 'variable', in Call to 'function', parameter X 
Error, Bad or missing expression after '+': 'variable name' 
+ being an incorrect operator usage? '&&'
Error, 'type' conversion: Bad or missing expression

Missing

Error, Missing 'function' 
Declared a function modifier without a function, defined a function type before function.
Correct and Wrong example
Error, Missing ')' in 'foreach array' 
The variable inside the brackets of a foreach loop is not defined.
Error, Missing ';' before 'variable name' 
The variable you are trying to access through a typecast is not defined.
Error, Missing ';' before ')' 
End of line expected before the character.
Correct and Wrong example
Error, ImportText (struct): Missing closing parenthesis:(member1='value',member2='value'))

Static Functions

Error, Can't call instance functions from within static functions 
Static functions can only call other static functions.
Error, You can only access default values of variables here 
Tried to assign a non default variable a value, using a non default variable in a statement, assigning a variable a value from another that is not a default variable. There are instances where you can access non default variables in Static functions, if the variable is part of the function definition, a local variable.

Mismatch

Error, Type mismatch in Call to 'function name', parameter number 
the type of variable being passed to the function

parameter number specified is incorrect.

Error, Type mismatch in '=' 
you probably wanted to make a boolean compare "==" but ended up assigning something to a variable.
Error, Const mismatch with '+' 

Warnings

Warning, Unresolved reference to Class 'class name' 
Warning, Function parameter
'function name' conflicts with previously defined field in 'class name' :
Warning, function: Missing return value 
a function with a return type has no 'return' that could be reached, for example if the only return is in an if-block and thus can't be accessed in all cases.
Warning, Using a non-qualified name (would have) found: object package.group.group.name
Warning, Unresolved reference to object
Warning, friendly operator name_TypeNameTypeName: Missing return value 
This is similar to function not having a return value but is the operator version, UScript supports operator overloading so the 'friendly operator name will be a reference to a table within the engine $ being Concat as an example.
Warning, Class ClassName can't bind to DLL DLLPath.

Local Variables

Warning, 'variable name': unused local variable 
a local variable has been declared but isn't used in the code and can be deleted.
Warning, 'variable name' : local variable used before assigned a value 
a variable is referenced before it is assigned a value, which means it'll return the default value for that type, whether that is what you are looking for or not. This could be conditionally incorrect, the compiler doesnt check to see in which order things are carried out so it could infact be wrong, hence only a warning.
Warning, 'variable name' : unreferenced local variable 
a variable is declared within a function and never assigned a value.

Default Properties

Warning, Import failed for 'variable name': property is config (Check to see if the property is listed in the DefaultProperties. It should only be listed in the specific .ini/.int file) 
Warning, Unknown property in defaults: 'line from defaultproperties block' 
Warning, Invalid property value in defaults: property=value 
a property in the defaults is not a defined variable.
Warning, redundant data: 'line from defaultproperties block'
Warning, ObjectProperty package.class.property: unresolved reference to object'package.group.object' 
the specified object could not be found in the package.
Warning, Unable to parse parameter value in defaultproperties array operation: array<struct>.add((member1='value',member2='value'))

Failure

Failed to load 'object package.group.name': Failed to find object 'object package.group.name'