Compilation error when referencing ULocalPlayer

I’ve got a fork of UE4.6 that up until 4.6 has been working just fine. After I synced with the most recent changes, I’m having an issue:

27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(133): error C2504: 'UPlayer' : base class undefined
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(184): error C3668: 'ULocalPlayer::PostInitProperties' : method with override specifier 'override' did not override any base class methods
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(185): error C3668: 'ULocalPlayer::BeginDestroy' : method with override specifier 'override' did not override any base class methods
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(186): error C3668: 'ULocalPlayer::FinishDestroy' : method with override specifier 'override' did not override any base class methods
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(191): error C3668: 'ULocalPlayer::Exec' : method with override specifier 'override' did not override any base class methods
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(213): error C3668: 'ULocalPlayer::HandleDisconnect' : method with override specifier 'override' did not override any base class methods
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(134): error C3861: 'GetOuter': identifier not found
27>C:\Projects\UE4.3Fork\Engine\Source\Runtime\Engine\Classes\Engine/LocalPlayer.h(134): error C2440: 'return' : cannot convert from 'ULocalPlayer *' to 'UObject *'

It’s complaining that ULocalPlayer doesn’t include UPlayer (it doesn’t). I assume that’s happening in the macro magic.

This compile error wasn’t here in 4.5, the exact code that causes it is a line in my game code:

ULocalPlayer *player = GetWorld()->GetFirstLocalPlayerFromController();

This line causes the error. I’ve tried to include Engine/LocalPlayer.h and it doesn’t help.

Any clue as to what is going on here?

Hey,

i’m using 4.6.0 from the Launcher an i just created a fresh class to test your line. I don’t get any Errors. It compiles fine.

Are you sure that your Engine isn’t messed up? :X

Do you get the same error in a new, clean project?

It’s a fork.

Yop, still if you have the Player.h and the LocalPlayer.h, it shouldn’t give you this error. Tried including Engine/Player.h?

Ok, so the problem is simple enough.

I was still seeing this issue, and a workaround was including Player.h and LocalPlayer.h, in the correct order. Stupid workaround.

The real solution is to simply include Engine.h. Including this file means you can delete the Player and LocalPlayer includes as they’re no longer necessary.

This apparently wasn’t an issue in the previous versions of the engine, but now with whatever they’ve done to simplify things that’s the way to do it.