Using UE4 memory allocation in third party libs

I was able to reproducible the same error in the home.

I’ve never experienced this in the office. It should be compiled without any errors…so weird. I’m going to tell this to my team so they can fix the issue. I’ll let you know if I found the cause. thanks for the error anyway!

Sorry for disturbing, maybe you have any news on this issue ?

Sadly, No. I think I can spare more time tomorrow because It’s almost 12:00 am In my country. I promise I’ll bring good news tomorrow anyway.

Thanks a lot for your assistance!!!

What I found is that the problem is reproducible in any environment, which seems a high priority issue. I’ll discuss with my coworker tomorrow to fix this issue.

Hi, Could you retry again without unity build option? I heard that option is enabled by the default. There’s a bug that Unreal Engine is not able to identify specific file extension(.cc) in 4.21 (fixed in 4.22).

You have two choices to avoid that. one is replacing the generated Protobuf file’s extension to .cpp, Or turning off Unity build option.

Yes, met this issue - replaced .cc to cpp.

Hi, do you have any news on this issue ?

Did you try again without Unity build option?

No, didn’t try, I renamed .cc to .cpp and got issue with c++17 feature compilation.

It seems that the Unreal Engine is merging generated files when the Unity build option is enabled. so you have to turn off the option manually for now.

Ok, thanks will try it, could you help please - how can I disable Unity build ?

Set the below flag in your Build.cs file.

BuildConfiguration.bUseUnityBuild = false;

If you’re not familiar with this, you can find a similar setting on Github(search with the bUseUnityBuild keyword).

Thanks a lot, yes I know what are you talking about :slight_smile: Will try it! Will keep you updated.

Unfortunately can’t compile - getting a lot of errors. BTW can’t find bUseUnityBuild = false; in your example project. Is your example from github compilable ?

You can add bUseUnityBuild = false; in {ProjectName}.Target.cs file too. Please try this if you didn’t. Currently, I’m not available to use my computer but I was able to build the project in the office.

Yes, tried this in project target.cs, but can’t see this option in your .cs file. Which branch should I try from your poject - master or experimental ?

As far as I know, We didn’t merge that fix in the master(stable) branch, so you should try with the experimental version.

You should put that option manually because we haven’t touched it.

Just tried to build experimental branch of fun api project under win10. Firstly ran ChangeExtensions.bat to change .cc extensions and then simply tried to open project. Got a message that I have to compile modules : funapi_plugin_ue4 and Funapi. And answered yes to rebuild them. The build process started and I got a bunch of error messages like

 d:\engine-plugin-ue4-experimental\Plugins\Funapi\Source\Funapi\Private\google\protobuf\extension_set_heavy.cpp(151): error C2668: 'google::protobuf::internal::cpp_type': ambiguous call to overloaded function
  d:\engine-plugin-ue4-experimental\Plugins\Funapi\Source\Funapi\Private\google\protobuf\extension_set_heavy.cpp(127): note: could be 'google::protobuf::FieldDescriptor::CppType google::protobuf::internal::cpp_type(google::protobuf::internal::FieldType)'
  d:\engine-plugin-ue4-experimental\Plugins\Funapi\Source\Funapi\Private\google\protobuf\extension_set.cpp(60): note: or       'google::protobuf::internal::WireFormatLite::CppType google::protobuf::internal::`anonymous-namespace'::cpp_type(google::protobuf::internal::FieldType)'
  d:\engine-plugin-ue4-experimental\Plugins\Funapi\Source\Funapi\Private\google\protobuf\extension_set_heavy.cpp(151): note: while trying to match the argument list '(const google::protobuf::internal::FieldType)'
  d:\engine-plugin-ue4-experimental\Plugins\Funapi\Source\Funapi\Private\google\protobuf\extension_set_heavy.cpp(166): error C2668: 'google::protobuf::internal::cpp_type': ambiguous call to overloaded function

Just tried to build experimental branch under Windows, and it doesn’t compile :frowning:
Do you build under windows ?