# FGeometryScriptPrimitiveOptions struct causing compile errors

**URL:** <https://forums.unrealengine.com/t/fgeometryscriptprimitiveoptions-struct-causing-compile-errors/719494>\
**Category:** C++\
**Tags:** unreal-engine, compile-error, question, CPP\
**Created:** [December 1, 2022, 6:55pm UTC](https://forums.unrealengine.com/t/fgeometryscriptprimitiveoptions-struct-causing-compile-errors/719494 "2022-12-01T18:55:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leshy271](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leshy271](https://forums.unrealengine.com/u/Leshy271)\
**Post date:** [December 1, 2022, 6:55pm UTC](https://forums.unrealengine.com/t/fgeometryscriptprimitiveoptions-struct-causing-compile-errors/719494/1 "2022-12-01T18:55:19Z")

</div>

Hello everyone

Recently I started learning C++ for UE5. I also started playing around with geometry scripting and I wanted to try writing some C++ code for it. So I created a child C++ from DynamicMeshActor, but whenever I try to use the FGeometryScriptPrimitiveOptions struct as a function argument, I get compile errors (same thing happens when I try to use it as a variable)  
Here’s the header:

```auto
#pragma once

#include "CoreMinimal.h"
#include "DynamicMeshActor.h"
#include "GeometryScript/MeshPrimitiveFunctions.h"
#include "DynamicMeshTest.generated.h"

/**
 * 
 */
UCLASS()
class CPPTEST_API ADynamicMeshTest : public ADynamicMeshActor
{
	GENERATED_BODY()
	
public:
	ADynamicMeshTest();

public:
	UFUNCTION(BlueprintCallable) 
		void Build(FGeometryScriptPrimitiveOptions PrimitiveOptions);
};

```

And here’s the CPP file:

```auto

#include "DynamicMeshTest.h"

ADynamicMeshTest::ADynamicMeshTest()
{
	PrimaryActorTick.bCanEverTick = false;
}
void ADynamicMeshTest::Build(FGeometryScriptPrimitiveOptions PrimitiveOptions)
{
	UDynamicMeshComponent* DynamicMeshComp = FindComponentByClass<UDynamicMeshComponent>();
	UDynamicMesh* DynamicMesh = DynamicMeshComp->GetDynamicMesh();
}

```

And the errors I’m getting:

 ![Screenshot 2022-12-01 170941](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/a/05a3987290d57481b2ad9a217198b62a20a85d27.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Cherry9s](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cherry9s](https://forums.unrealengine.com/u/Cherry9s)\
**Post date:** [May 22, 2024, 3:39am UTC](https://forums.unrealengine.com/t/fgeometryscriptprimitiveoptions-struct-causing-compile-errors/719494/2 "2024-05-22T03:39:53Z")

</div>

If you are compiling an error within your own plugin, you may have forgotten to add a module reference and added a “GameFramework” reference in Build.cs
