# Need help with some code!

**URL:** <https://forums.unrealengine.com/t/need-help-with-some-code/39821>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [August 26, 2015, 6:02pm UTC](https://forums.unrealengine.com/t/need-help-with-some-code/39821 "2015-08-26T18:02:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vulka3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vulka3](https://forums.unrealengine.com/u/Vulka3)\
**Post date:** [August 26, 2015, 6:02pm UTC](https://forums.unrealengine.com/t/need-help-with-some-code/39821/1 "2015-08-26T18:02:12Z")

</div>

Hi, I’m kinda new to all this and I need some help with the coding. I’m reading and following a book by PaktPublishing and I ran into trouble while following along. I have the following code:

UCLASS()  
class GOLDENEGG\_API ANPC : public ACharacter  
{  
GENERATED\_UCLASS\_BODY()  
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category =  
Collision)  
TSubobjectPtr\<class USphereComponent\> ProxSphere;  
// This is the NPC’s message that he has to tell us.  
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =  
NPCMessage)  
FString NpcMessage;  
// When you create a blueprint from this class, you want to be  
// able to edit that message in blueprints,  
// that’s why we have the EditAnywhere and BlueprintReadWrite  
// properties.  
}

I copied and pasted the code and changed the “GENERATED\_UCLASS\_BODY()” part with just “GENERATED\_BODY()” since I’m using UE4.8.3 (this was actually there I just copied whats next) and I also changed the “ACharacter” with “ANPCCharacter” since my Character class is called “NPCCharacter”.

So with whats above as example I have the following code that doesn’t compile:

UCLASS()  
class GOLDENEGG\_API ANPC : public ANPCCharacter  
{  
GENERATED\_BODY()  
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Collision)  
TSubobjectPtr\<class USphereComponent\> ProxSphere;  
// This is the NPC’s message that he has to tell us.  
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = NPCMessage)  
FString NpcMessage;  
};

Anyway so when I try to compile I get these errors:

1. error code: OtherCompilationError (5)
2. error MSB3073: The command ““C:\Program Files\Epic Games\4.8\Engine\Build\BatchFiles\Build.bat”  
GoldenEggEditor Win64 Development “C:\Users&lt;user\>\Documents\Unreal Projects\GoldenEgg\GoldenEgg.uproject” -  
rocket” exited with code -1.

When I delete the contents of the under “GENERATED\_BODY()” all compiles well.  
Please help!!!  
Thanks in advance!
