Why does this happen?

  1. Start new code project
  2. Create new class based on PostProcessComponent
  3. Build
  4. Fail spectacularly

Is someone able to explain what’s going on here? I’ve been able to solve virtually everything else I’ve come across in c++ but this one still eludes me. The code is simple and generated by UE and all it’s doing is extending a post-process component. There’s no other code in it yet.


>  -------------------------------------------------------------------------------1>  Initializing...
1>  --------------------Project: Default-------------------------------------------
1>  CelShader.generated.cpp (0:33.86 at +0:00)
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(15): error C2143: syntax error : missing ';' before '*'
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(21): warning C4510: 'FPostProcessVolumeProperties' : default constructor could not be generated
1>          D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(14) : see declaration of 'FPostProcessVolumeProperties'
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(21): error C4610: struct 'FPostProcessVolumeProperties' can never be instantiated - user defined constructor required
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(12): error C2504: 'USceneComponent' : base class undefined
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(18): error C2079: 'UPostProcessComponent::Settings' uses undefined struct 'FPostProcessSettings'
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(60): error C3668: 'UPostProcessComponent::OnRegister' : method with override specifier 'override' did not override any base class methods
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(61): error C3668: 'UPostProcessComponent::OnUnregister' : method with override specifier 'override' did not override any base class methods
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(14): error C2440: 'return' : cannot convert from 'UPostProcessComponent *' to 'UObject *'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(47): error C2512: 'FPostProcessVolumeProperties' : no appropriate default constructor available
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(49): error C2065: 'UShapeComponent' : undeclared identifier
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(49): error C2065: 'AttachParent' : undeclared identifier
1>D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Components/PostProcessComponent.h(53): error C2039: 'Settings' : is not a member of 'FPostProcessVolumeProperties'
1>          D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Interfaces/Interface_PostProcessVolume.h(14) : see declaration of 'FPostProcessVolumeProperties'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12): error C2079: 'UCelShaderComponent' uses undefined class 'PLUGINDEV_API'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12): error C2143: syntax error : missing ';' before ':'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12): error C2059: syntax error : ':'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12): error C2059: syntax error : 'public'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(13): error C2143: syntax error : missing ';' before '{'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(13): error C2447: '{' : missing function header (old-style formal list?)
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(12): error C2825: 'UCelShaderComponent': must be a class or namespace when followed by '::'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(12): error C2039: 'StaticRegisterNativesUCelShaderComponent' : is not a member of '`global namespace''
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(12): error C2146: syntax error : missing ';' before identifier 'StaticRegisterNativesUCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(12): error C2182: 'UCelShaderComponent' : illegal use of type 'void'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(12): error C2086: 'int UCelShaderComponent' : redefinition
1>          D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12) : see declaration of 'UCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(14): error C4508: 'StaticRegisterNativesUCelShaderComponent' : function should return a value; 'void' return type assumed
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2923: 'TClassCompiledInDefer' : 'UCelShaderComponent' is not a valid template type argument for parameter 'TClass'
1>          D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12) : see declaration of 'UCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2514: 'TClassCompiledInDefer' : class has no constructors
1>          d:\unreal engine\epic games\4.8\engine\source\runtime\coreuobject\public\uobject\UObjectBase.h(313) : see declaration of 'TClassCompiledInDefer'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2825: 'UCelShaderComponent': must be a class or namespace when followed by '::'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2039: 'GetPrivateStaticClass' : is not a member of '`global namespace''
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2146: syntax error : missing ';' before identifier 'GetPrivateStaticClass'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2373: 'UCelShaderComponent' : redefinition; different type modifiers
1>          D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12) : see declaration of 'UCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2065: 'StaticClassFlags' : undeclared identifier
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2974: 'GetPrivateStaticClassBody' : invalid template argument for 'TClass', type expected
1>          D:\Unreal Engine\Epic Games\4.8\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h(2402) : see declaration of 'GetPrivateStaticClassBody'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2440: 'return' : cannot convert from 'UClass *' to 'int'
1>          There is no context in which this conversion is possible
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15): error C2617: 'GetPrivateStaticClass' : inconsistent return statement
1>          D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(15) : see declaration of 'GetPrivateStaticClass'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(25): error C2825: 'UCelShaderComponent': must be a class or namespace when followed by '::'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(25): error C2039: 'StaticClass' : is not a member of '`global namespace''
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(25): error C2146: syntax error : missing ';' before identifier 'StaticClass'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(25): error C3861: 'StaticClass': identifier not found
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(34): error C2825: 'UCelShaderComponent': must be a class or namespace when followed by '::'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(34): error C2039: 'StaticClass' : is not a member of '`global namespace''
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(34): error C2440: '=' : cannot convert from 'int' to 'UClass *'
1>          Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(34): error C2146: syntax error : missing ';' before identifier 'StaticClass'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(34): error C3861: 'StaticClass': identifier not found
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C2825: 'UCelShaderComponent': must be a class or namespace when followed by '::'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C2143: syntax error : missing ';' before 'UCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C2086: 'int UCelShaderComponent' : redefinition
1>          D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Source\CelShader\Public/CelShaderComponent.h(12) : see declaration of 'UCelShaderComponent'
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C2063: 'UCelShaderComponent' : not a function
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C3755: 'UCelShaderComponent': a delegate may not be defined
1>D:\Dropbox\Work\Games\Projects\PluginDev\Plugins\CelShader\Intermediate\Build\Win64\UE4Editor\Inc\CelShader\CelShader.generated.cpp(54): error C2065: 'Helper' : undeclared identifier
1>  
1>  Error executing C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe (tool returned code: 2)

Celshadercomponent.h:


// Fill out your copyright notice in the Description page of Project Settings.

#pragma once


#include "Components/PostProcessComponent.h"
#include "CelShaderComponent.generated.h"


/**
 * 
 */
UCLASS()
class PLUGINDEV_API UCelShaderComponent : public UPostProcessComponent
{
    GENERATED_BODY()
    
    
    
    
};




Celshadercomponent.cpp:


// Fill out your copyright notice in the Description page of Project Settings.

#include "CelShaderPrivatePCH.h"
#include "CelShaderComponent.h"










If you look at the file, it has this on line 15:

const FPostProcessSettings* Settings;

Apparently it doesn’t know FPostProcessSettings yet, so I think you could try to include the header file that declares this class or struct before you include “Components/PostProcessComponent.h”

Ah, the order matters? Thanks, I’ll give a few more things a go. I’ve re-treading old ground but I can’t remember where I stalled last time!