Using UE4 memory allocation in third party libs
I have a problem and need community help. I'm trying to use third party library (in particular google protobuf), but have an issue with iOS shipping build like described here https://answers.unrealengine.com/questions/869991/weird-behavior-with-stdstringstream-on-iphone-xs.html . According to workaround I decided to replace STL allocator and use UE allocation (FMemory::Malloc FMemory::Free etc.), but have an issue with compiling protobuf library - I have to link implementation of UE memory functions, how can I do this ? Does UE4 have compiled static libs or can I get it from source ?
asked Mar 27 '19 at 08:19 AM in C++ Programming
Hi, You don't need to rebuild the Protobuf library. it would be a tough work since you're linking Unreal's library with Protobuf so I'm not sure that it is a good way to fix this.
My Team made a script (.sh/.bat) to replace the std containers that are in generated code. (in pb.cc) You can also see that script files too in the repository.
If you're using Cmake or similar build system, You may have to add "add_custom_command()" and make it executes every time when you generate these pb.cc files.
answered Mar 27 '19 at 08:48 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here