UHT cant handle #if WITH_EDITOR

UHT generate data for properties marked #if WITH_EDITOR #endif.

Also, UHT generates UCLASS meta even if it wrapped #if WITH_EDITOR #endif.

I’ve checked 4.17 patch notes, it has fix info UHT properly generate around UFUNCTION().

#if WITH_EDITOR

UPROPERTY(EditAnywhere, DisplayName = "Display Overlap (Editor Only)", Category = "Prox Trigger | Preset")
bool bDisplayOverlap_EditorOnly;

#endif

Compile shipping Error:

...\CustomActionProxTrigger.h(21): error C2039: 'bDisplayOverlap_EditorOnly': is not a member of 'ACustomActionProxTrigger'

screenshot of a code and .generated.h :

http://puu.sh/xdZCL.png

http://puu.sh/xdZBu.png

Hi,

This looks like a bug specifically to do with blueprint nativisation. I’ll file a ticket to get it fixed.

Sorry for the trouble,

Steve

Can I just confirm that you’re using 4.17? You mention the patch notes of 4.17, but the Product Version of your issue says 4.16.

Steve

I’m using 4.16 and mentioned 4.17 because I saw kinda related issue fixed there, so im not sure in most recent version this exact issue is not fixed.

I’m getting this exact same error in 4.18.1.

Generated files are referencing variables enclosed by WITH_EDITOR ifdefs in non-editor builds

Same here with 4.18.2. @Steve is there an estimate on when this issue is going to be fixed?

same here with 4.20.1.

Have you tried using WITH_EDITORONLY_DATA instead of WITH_EDITOR?

#if WITH_EDITORONLY_DATA
UPROPERTY()
bool bDisplayOverlap_EditorOnly;
#endif

The Unreal engine is using that around editor only properties.There is a short thread about it as well: https://answers.unrealengine.com/questions/48062/with-editor-vs-with-editoronly-data.html

1 Like