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"

'StaticStruct': is not a member of 'FTest'

I'm trying to create a struct with C++ but I am receiving this compiling error:

'StaticStruct': is not a member of 'FTest'

This is my code:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "CoreMinimal.h"
 #include "Kismet/BlueprintFunctionLibrary.h"
 
 /**
  *
  */
 USTRUCT(BlueprintType)
 struct MYPROJECT_API FTest
 {
     GENERATED_BODY();
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Test")
     FString name;
 };



Product Version: UE 4.21
Tags:
more ▼

asked Dec 15 '18 at 11:27 AM in C++ Programming

avatar image

Cucharón
22 2 6 10

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Have you included your generated.h file? If your header was called MyFile.h, then your generated.h file would be MyFile.generated.h and should be the last header you include.

more ▼

answered Dec 15 '18 at 12:31 PM

avatar image

Jamie Dale STAFF
7.3k 176 66 304

avatar image Cucharón Dec 15 '18 at 01:02 PM

Wow, it solved it! Thank you!

(comments are locked)
10|2000 characters needed characters left

Hey, you should use

 GENERATED_STRUCT_BODY();

Instead of the Classic one :-)

more ▼

answered Dec 15 '18 at 12:24 PM

avatar image

Firefly74
1.3k 11 15 29

avatar image Jamie Dale STAFF Dec 15 '18 at 12:38 PM

Wrong way around. GENERATED_BODY is the new version that works with everything, whereas GENERATED_USTRUCT_BODY is the old version.

avatar image Firefly74 Dec 15 '18 at 01:06 PM

Oh ok, didn't knew it changed, sorry .

(comments are locked)
10|2000 characters needed characters left
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