[4.7] I can't still add more than one Unreal classes in single C++ header

following C++ improvements from 4.7 are not still working.

  • You can now have more than one Unreal class in a single C++ header file
  • You no longer are required to name your source file the same as your Unreal class name.

Case 1

// in PFBattleGameMode.h

UCLASS()
class PFCLIENT_API APFBattleGameMode : public APFGameModeBase
{
	GENERATED_BODY()
};

UCLASS()
class PFCLIENT_API UTestAdditionalClass : public UObject
{
	GENERATED_BODY()
};

1> Parsing headers for PFClientEditor

1> C:/workspace/dochigun-pc/PFClient/Source/PFClient/Classes/PFBattleGameMode.h(128): error : In PFBattleGameMode: Can only declare one class per file (two for an interface)


Case 2

// in PFBattleGameMode.h

UCLASS()
class PFCLIENT_API UTestAdditionalClass : public UObject
{
	GENERATED_BODY()
};

UCLASS()
class PFCLIENT_API APFBattleGameMode : public APFGameModeBase
{
	GENERATED_BODY()
};

1> Parsing headers for PFClientEditor

1> C:/workspace/dochigun-pc/PFClient/Source/PFClient/Classes/PFBattleGameMode.h(68): error : Invalid class name ‘UTestAdditionalClass’. The class name must match the name of the class header file it is contained in (‘PFBattleGameMode’), with an appropriate prefix added (A for Actors, U for other classes)

Getting the same issue on 4.7.1:

error : Invalid class name 'UTestClass_Base'. The class name must match the name of the class header file it is contained in ('TestClasses'), with an appropriate prefix added (A for Actors, U for other classes)

Same here :frowning:

Hi guys,
sorry for the confusion, but the change haven’t made it to the 4.7. It will be in 4.8.

We’re investigating why it was included in the release notes.

Thanks,
Jarek

Thanks for the reply Jarek, just good to know that I wasn’t doing something wrong haha.