# Error: 'struct' Can't find struct 'FObjectAndNameAsStringProxyArchive'

**URL:** <https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 24, 2019, 1:08am UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744 "2019-07-24T01:08:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vycanis1801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vycanis1801](https://forums.unrealengine.com/u/vycanis1801)\
**Post date:** [July 24, 2019, 1:08am UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/1 "2019-07-24T01:08:09Z")

</div>

Here’s my code. Not what’s wrong. Or why I’m having such a hard time with structs in general. Like why I can’t just make a c++ struct from the editor. Or having to do something weird.  
#pragma once

```
#include "CoreMinimal.h"
#include "GameFramework/SaveGame.h"
#include "Structs/SaveData.h"
#include "Serialization/ObjectAndNameAsStringProxyArchive.h"
#include "MeatSaveGame.generated.h"

/**
 *
 */
USTRUCT(BlueprintType)
struct FMeatSaveGameArchive : public FObjectAndNameAsStringProxyArchive
{
	GENERATED_BODY()
	FMeatSaveGameArchive(FArchive& InInnerArchive)
		: FObjectAndNameAsStringProxyArchive(InInnerArchive, true)
	{
		ArIsSaveGame = true;
		ArNoDelta = true;
	}
};

/**
 * 
 */
UCLASS(BlueprintType)
class MEAT_API UMeatSaveGame : public USaveGame
{
	GENERATED_BODY()
public:
	UMeatSaveGame();

	UPROPERTY(VisibleAnywhere, Category = Basic)
	uint32 SlotIndex;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Basic)
	FSaveData SaveData;
};
```

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [July 24, 2019, 5:12pm UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/2 "2019-07-24T17:12:32Z")

</div>

I’m not in a position to test at the moment but my gut feeling is:

- Blueprints don’t like inheritance in struct (unless something has changed since I last checked). Get rid of the USTRUCT(BlueprintType) and replace with USTRUCT(). You might find that just removing USTRUCT altogether is required.
- GENERATE\_BODY should be removed as your constructors are provided

---

<div class="post-metadata">

**Author:** ![vycanis1801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vycanis1801](https://forums.unrealengine.com/u/vycanis1801)\
**Post date:** [July 24, 2019, 5:16pm UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/3 "2019-07-24T17:16:35Z")

</div>

Yeah, I can’t use any of the macros like USTRUCT() or GENERATED\_BODY() either. So, that means I won’t be able to use it as a uproperty in some other class?

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [July 24, 2019, 5:43pm UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/4 "2019-07-24T17:43:11Z")

</div>

I don’t think you’d want to use FMeatSaveGameArchive as a UPROPERTY. I think you linked to this tutorial in an earlier question which shows it being used with MemoryWriter:

[http://runedegroot.com/saving-and-loading-actor-data-in-unreal-engine-4/#comments](http://runedegroot.com/saving-and-loading-actor-data-in-unreal-engine-4/#comments)

Basically, you don’t want to have FMeatSaveGameArchive as a member variable of anything, you just use it as part of the serialization / deserialization process.

---

<div class="post-metadata">

**Author:** ![vycanis1801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vycanis1801](https://forums.unrealengine.com/u/vycanis1801)\
**Post date:** [July 24, 2019, 6:04pm UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/5 "2019-07-24T18:04:41Z")

</div>

But to use it in say, a function. I’d still need to declare the struct yes?

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [July 24, 2019, 9:55pm UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/6 "2019-07-24T21:55:37Z")

</div>

Declaring has nothing to do with the USTRUCT or any other property specifiers. You declare the struct just by creating it ([Struct declaration - cppreference.com](https://en.cppreference.com/w/c/language/struct))

The USTRUCT etc exposes the struct to unreal and helps with memory management etc, but the absence of USTRUCT / UCLASS / UFUNCTION doesn’t normally stop you using it as you’d expect within normal C++. So if you wanted to create a FMeatSaveGameArchive variable within a function, you can do so. If you want to pass it around to other functions either as a value type or reference then you can also do that. The only thing you might need to watch out for is memory management.

Basically, think of it like a normal member variable. You don’t have to use UPROPERTY(), but if you don’t then you just need to be a little more careful.

---

<div class="post-metadata">

**Author:** ![vycanis1801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vycanis1801](https://forums.unrealengine.com/u/vycanis1801)\
**Post date:** [July 25, 2019, 12:30am UTC](https://forums.unrealengine.com/t/error-struct-cant-find-struct-fobjectandnameasstringproxyarchive/452744/7 "2019-07-25T00:30:37Z")

</div>

Cool. I wanted to make sure that was the case. Thanks for the responses 🙂
