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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Error: an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_trivially_destructible'

I'm getting an error I don't understand.

I have a struct called FLilaParameter, which I have defined in a file called LilaStructsAndEnums.h:

 LilaStructsAndEnums.h
 
 USTRUCT(BlueprintType)
 struct FLilaParameter
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ParameterName;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         float Value;
 
     FLilaParameter()
     {
         ParameterName = TEXT("ParameterName");
         Value = 0.0f;
     }
 
     FLilaParameter(FName _ParameterName, float _Value)
     {
         ParameterName = _ParameterName;
         Value = _Value;
     }
 };

...

In another class called LilaBrushDynamic, I want to have an array of these structs. Here is the code for that class:

...

 LilaBrushDynamic.h
 
 #pragma once
 
 #include "CoreMinimal.h"
 #include "GameFramework/Actor.h"
 #include "LilaBrushDynamic.generated.h"
 
 struct FLilaParameter;
 
 UCLASS()
 class LILA_API ALilaBrushDynamic : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     ALilaBrushDynamic();
 
     TArray<FLilaParameter> ParametersArray;
 
 protected:
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
 };

When I try to build, I get the following error:

Error C2139 'FLilaParameter': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_trivially_destructible' C:\Program Files (x86)\Epic Games\UE_4.17\Engine\Source\Runtime\Core\Public\Templates\IsTriviallyDestructible.h 18

What's going on here? Why can't I have an array of this struct that has been defined?

Product Version: UE 4.17
Tags:
more ▼

asked Sep 20 '17 at 07:12 PM in C++ Programming

avatar image

localstarlight
63 15 22 29

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

1 answer: sort voted first

Include LilaStructsAndEnums.h file instead of declaing it in LilaBrushDynamic line 9

more ▼

answered Jan 25 '18 at 08:40 PM

avatar image

Stan
8 2 3 6

(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