# Protobuf deserialization trouble

**URL:** <https://forums.unrealengine.com/t/protobuf-deserialization-trouble/2173270>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [December 5, 2024, 10:21am UTC](https://forums.unrealengine.com/t/protobuf-deserialization-trouble/2173270 "2024-12-05T10:21:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seb3D](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Seb3D](https://forums.unrealengine.com/u/Seb3D)\
**Post date:** [December 5, 2024, 10:21am UTC](https://forums.unrealengine.com/t/protobuf-deserialization-trouble/2173270/1 "2024-12-05T10:21:51Z")

</div>

Hello all!  
I’m trying to use the protobuf version (3.18.0) included in Unreal, using the engine’s compiled source code.

```auto
void InstallationApplicationService::CreateInstallation(const google::protobuf::Message& Message)
{
	const Installation& InstallationMessage = static_cast<const Installation&>(Message);
	UE_LOG(LogTemp, Log, TEXT("InstallationMessage DebugString: %s"), *FString(InstallationMessage.DebugString().c_str()));
	UE_LOG(LogTemp, Log, TEXT("InstallationMessage length: %d"), InstallationMessage.length());
}

```

The message is well formed and valid.  
InstallationMessage.DebugString() correctly print the contained informations :

```auto
InstallationMessage DebugString: installation_id: "123"
name: "Test"
length: 10
width: 15.5

```

But it crashes when accessing different attributes, regardless of their type.  
I guess because of poorly deserialized field: int, float, string size have huge value, like

```auto
InstallationMessage length: -244143296

```

Do you know if there are any issues with this version of protobuf in c++?  
And so trying a newer version can resolve this, or do you know any other issue with the static\_cast of a generated protobuf class?
