Unrecognized type 'FSocket'

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


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

#pragma once

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

class UDPRECEIVERTEST_API AMyClass : public APlayerController

	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.

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.

any suggestions greatly appreciated

thank you!