Development package throws error but IDE build doesn't

When i’m trying to package a development build for my project in unreal engine, it throws in the log messages:

UATHelper: Packaging (Windows): F:\Unreal Projects\REDACTED\Source\REDACTED\Public\Common\Core\Use.h(27): error C2143: syntax error: missing ';' before '*'
UATHelper: Packaging (Windows): F:\Unreal Projects\REDACTED\Source\REDACTED\Public\Common\Core\Use.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
PackagingResults: Error: missing ';' before '*'
UATHelper: Packaging (Windows): F:\Unreal Projects\REDACTED\Source\REDACTED\Public\Common\Core\Use.h(27): error C2238: unexpected token(s) preceding ';'

The Specific Line is this:

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
	UBillboardComponent* Billboard;

Although when i build with IDE there is no such error. Even when i’m playing in editor it’s fine without problems. I recently have reorganized cpp and header files, but i have deleted Int, Build and Saved files and rebuilt. How can I fix this?

I’m guessing that in that file you are not including the header to UBillboardComponent and you have not forward declared it.

Try changing it to

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
class UBillboardComponent* Billboard; 

and be sure to add include “BillboardComponent.h” in your Use.cpp (with needed directories in front of it)

1 Like

It fixed it by forward declaring it. But I was thinking why didn’t the IDE flagged this error on build. I’m thinking it might be because i had already included the “BillboardComponent.h” in the “Use.cpp”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.