Compiler errors again and again Version 4.16

Hey everyone,

I start getting a little frustrated right now since I allways get weird compiler issues since the first line of code.
It started with GetOwner() not beeing somehow known to VS2017.
This could be solved by including “Engine.h” in the cpp although it doesn’t work all the time.
Now with the ATriggerVolume there are problems again.
As I ad this lines of code:
UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate;

I get the following errors:

I searched a lot and there is definitely no “;” missing somewhere.
Are you guys having the same problems ??

Okay I solved my problem for now.
Instead of Creating a ATriggerVolume Instance I used its parent class AVolume and that works just fine. Just in case anyone stumbles across this as well.

  • Luuke

Hello @Luuke_L - I just wanted to mention that it might be wiser to specify it more closely as TriggerVolume, instead of the Volume interface, and just include the header files required for that to work fine.
This way you won’t be able to choose any Volume in the game as a PressurePlate - only TriggerVolumes (which can Trigger things, which is the point of PressurePlate :slight_smile: ).

In order to do that - I think it’s best to include “Engine/TriggerVolume.h” header (some people might just include “Engine.h” but I find it to be a little more than is really required).

1 Like

Hey @Bajter :slight_smile:
thanks I actually ended up doing as you suggested :smiley:

Cheers again guys, just ran into this issue now.
Version 4.16 seems a bit boinked :frowning:

1 Like

To be honest I think it’s a good choice, this is caused by not including everything that might be required and including only the minimal set of features.
It’s healthy from the project perspective, less bloat, more precision. :slight_smile:

I have this same problem in 4.16.1. The suggestions here didn’t fix it. I tried them all and some of my own. It wasn’t until I tried compiling in the editor that the issues just disappeared completely. I messed around with it a little more and it seems like a bad compile in VS cannot always be corrected in VS. UE compile seems to fix these problems though.

Just like @Bajter suggested, including “Engine/TriggerVolume.h” solved the problem for me. However it wouldn’t compile in Visual Studio but it did compile in the Unreal Editor. Visual Studio also introduced IntelliSense errors on UCLASS() after including “Engine/TriggerVolume.h”. Additional research provided me with the solution for the IntelliSense problem where by restarting Visual Studio, squiggly lines are removed. I’m using VS2017 and UE 4.16.1

The issue I couldn’t solve was that VS doesn’t compile successfully but the editor does:

1 Like

Can’t seem to get this to go away: Error D:/unrealcourse/projects/Escape/BuildingEscape/Source/BuildingEscape/OpenDoor.h(32) : Error: Unrecognized type 'TriggerVolume' - type must be a UCLASS, USTRUCT or UENUM
I’ve included Engine/TriggerVolume.h at the top of my header file but it still won’t compile, and I have no clue what’s going wrong

private:
UPROPERTY(VisibleAnywhere)
	float OpenAngle = 60.f;
UPROPERTY(EditAnywhere)
	TriggerVolume *PressurePlate;

Have you tried rebuilding?
Is this an Intellisense error or compile error from the console? Epic Games suggests not using the Error Window for errors, because it gets lost on macros and a lot other things.
Check this out: https://docs.unrealengine.com/latest/INT/Programming/Development/VisualStudioSetup/

Needs to be

  ATriggerVolume* PressurePlate;

Privacy & Terms