Hello I’m trying to compile a masterserver class to communicate with my masterserver but this error occurs when trying to build. This error is based on Error C2338 You cannot use UObject method delegates with raw pointers.
Here is the code.
c:\program files\epic games\ue_4.15\engine\source\runtime\core\public\Delegates/DelegateInstancesImpl.h(669): error C2338: You cannot use UObject method delegates with raw pointers.
1> c:\program files\epic games\ue_4.15\engine\source\runtime\core\public\Delegates/DelegateInstancesImpl.h(835): note: see reference to class template instantiation ‘TBaseUObjectMethodDelegateInstance<false,UserClass,TTypeWrapper<void> (FHttpRequestPtr,FHttpResponsePtr,bool)>’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1> c:\program files\epic games\ue_4.15\engine\source\runtime\core\public\Delegates/DelegateSignatureImpl.inl(281): note: see reference to class template instantiation ‘TBaseUObjectMethodDelegateInstance<false,UserClass,void (FHttpRequestPtr,FHttpResponsePtr,bool)>’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1> c:\program files\epic games\ue_4.15\engine\source\runtime\core\public\Delegates/DelegateSignatureImpl.inl(512): note: see reference to function template instantiation ‘TBaseDelegate<void,FHttpRequestPtr,FHttpResponsePtr,bool> TBaseDelegate<TTypeWrapper<void>,FHttpRequestPtr,FHttpResponsePtr,bool>::CreateUObject<UserClass,>(UserClass ,void (__cdecl MasterServerHandler:: )(FHttpRequestPtr,FHttpResponsePtr,bool))’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1> c:\program files\epic games\ue_4.15\engine\source\runtime\core\public\Delegates/DelegateSignatureImpl.inl(512): note: see reference to function template instantiation ‘TBaseDelegate<void,FHttpRequestPtr,FHttpResponsePtr,bool> TBaseDelegate<TTypeWrapper<void>,FHttpRequestPtr,FHttpResponsePtr,bool>::CreateUObject<UserClass,>(UserClass ,void (__cdecl MasterServerHandler:: )(FHttpRequestPtr,FHttpResponsePtr,bool))’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1> C:\PROJECTFURYGAME\Workspace\ProjectFury\Source\FPSTemplate\BaseMasterServer.cpp(81): note: see reference to function template instantiation ‘void TBaseDelegate<TTypeWrapper<void>,FHttpRequestPtr,FHttpResponsePtr,bool>::BindUObject<MasterServerHandler,>(UserClass ,void (__cdecl MasterServerHandler:: )(FHttpRequestPtr,FHttpResponsePtr,bool))’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1> C:\PROJECTFURYGAME\Workspace\ProjectFury\Source\FPSTemplate\BaseMasterServer.cpp(81): note: see reference to function template instantiation ‘void TBaseDelegate<TTypeWrapper<void>,FHttpRequestPtr,FHttpResponsePtr,bool>::BindUObject<MasterServerHandler,>(UserClass ,void (__cdecl MasterServerHandler:: )(FHttpRequestPtr,FHttpResponsePtr,bool))’ being compiled
1> with
1>
1> UserClass=MasterServerHandler
1> ]
1>ERROR : UBT error : Failed to produce item: C:\PROJECTFURYGAME\Workspace\ProjectFury\Binaries\Win64\UE4Editor-FPSTemplate.dll
1> Total build time: 3.82 seconds (Local executor: 0.00 seconds)
Now here is line 81 in my class
Are you trying to create a callback?
I got it fixed now sir. It was just because I had to use BindRaw instead of BindUObject
3 Likes
Thanks was facing this issue for long!!