x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Help!

Product Version: Not Selected
Tags:
more ▼

asked Feb 17 '15 at 02:15 AM in C++ Programming

avatar image

pansensory
8 1 2 4

avatar image pansensory Feb 17 '15 at 08:01 PM

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.

avatar image pansensory Feb 18 '15 at 05:42 PM

any suggestions greatly appreciated

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Feb 18 '15 at 05:46 PM

avatar image

mpie
211 9 3 11

avatar image pansensory Feb 18 '15 at 05:53 PM

thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question