# Unrecognized type 'FSocket'

**URL:** <https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167>\
**Category:** C++\
**Tags:** sockets, socket, fsocket, unreal-engine, UE4, question, CPP\
**Created:** [February 17, 2015, 2:15am UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167 "2015-02-17T02:15:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pansensory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pansensory](https://forums.unrealengine.com/u/pansensory)\
**Post date:** [February 17, 2015, 2:15am UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167/1 "2015-02-17T02:15:21Z")

</div>

Ok this is driving me a little crazy. I am unable to build my class because of an **Unrecognized type ‘FSocket’** error in my header.

But I feel like I’m doing everything right. I’ve added **“Sockets”** and **“Networking”** to the **PublicDependencyModuleNames** in the build config and I’ve put a **#include “Sockets.h”** and **#include “Networking.h”** at the top of my header file, but as soon as I try to create a FSocket property it complains.

I even checked to make sure there is a declaration of FSocket in Sockets.h and it’s there.

I can instance FSockets in my class constructor all I want, but I can’t mention them in the header.

Unreal Engine 4.6.1 and MS Visual Studio 2013

Help!

---

<div class="post-metadata">

**Author:** ![pansensory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pansensory](https://forums.unrealengine.com/u/pansensory)\
**Post date:** [February 17, 2015, 8:01pm UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167/2 "2015-02-17T20:01:44Z")

</div>

Specifically, this won’t compile due to **Unrecognized type ‘FSocket’** :

```
#pragma once

#include "GameFramework/PlayerController.h"
#include "Sockets.h"
#include "AMyClass.generated.h"

/**
 * 
 */
UCLASS()
class UDPRECEIVERTEST_API AMyClass : public APlayerController
{
	GENERATED_BODY()

	UPROPERTY()
	FSocket* Socket;

	AMyClass(const FObjectInitializer& ObjectInitializer);
	
};

```

But I have this line in the build.cs:

```
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Sockets", "Networking" });

```

And I know the build.cs is getting invoked, because if I mistype **Sockets** it will complain.

---

<div class="post-metadata">

**Author:** ![pansensory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pansensory](https://forums.unrealengine.com/u/pansensory)\
**Post date:** [February 18, 2015, 5:42pm UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167/3 "2015-02-18T17:42:15Z")

</div>

any suggestions greatly appreciated

---

<div class="post-metadata">

**Author:** ![marotili](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@marotili](https://forums.unrealengine.com/u/marotili)\
**Post date:** [February 18, 2015, 5:46pm UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167/4 "2015-02-18T17:46:08Z")

</div>

This is actually an error from the UnrealHeaderTool. You can’t use FSocket as a property because it is not a USTRUCT.  
It should compile when you remove the UPROPERTY() macro.

---

<div class="post-metadata">

**Author:** ![pansensory](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pansensory](https://forums.unrealengine.com/u/pansensory)\
**Post date:** [February 18, 2015, 5:53pm UTC](https://forums.unrealengine.com/t/unrecognized-type-fsocket/307167/5 "2015-02-18T17:53:08Z")

</div>

thank you!
