Adding a new code class derived from AnimInstance will cause the Visual Studio build to fail in a project based on the code Vehicle template. The build errors indicate that there are problems in the ShowFlags.h file:

Add the line #include "EngineBaseTypes.h" to the ShowFlags.h file.

Steps to Reproduce
  1. Create a new project using the code Vehicle template.
  2. Build the project in Visual Studio.
  3. Open the project in the Editor.
  4. Add a new code class to the project derived from AnimInstance.
  5. Close the Editor.
  6. Build the project in Visual Studio.

The build fails.

The build succeeds.

1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(378): error C2065: 'EViewModeIndex' : undeclared identifier
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(378): error C2146: syntax error : missing ')' before identifier 'ViewModeIndex'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(378): error C2182: 'ApplyViewMode' : illegal use of type 'void'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(378): error C2491: 'ApplyViewMode' : definition of dllimport data not allowed
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(378): error C2059: syntax error : ')'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(381): error C2061: syntax error : identifier 'EViewModeIndex'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(387): error C2146: syntax error : missing ';' before identifier 'FindViewMode'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(387): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(390): error C2146: syntax error : missing ')' before identifier 'ViewModeIndex'
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(390): error C2440: 'initializing' : cannot convert from 'int' to 'const TCHAR *'
1>          Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>d:\main-builds\ue4\engine\source\runtime\engine\public\ShowFlags.h(390): error C2059: syntax error : ')'

Have Comments or More Details?

Head over to the existingAnswerHub thread and let us know what's up.

Login to Vote

Affects Versions4.
Fix Commit2373654
CreatedDec 1, 2014
ResolvedDec 2, 2014
UpdatedApr 27, 2018