Problem
Comparing strings during the Unreal Engine debugging is complicated. FString::Compare and FString::Equals don't work and result in error: error: no member named 'Equals' in 'FString'
Cause
These methods cannot be used for evaluation during debugging. Unfortunately, by default, it is not possible to use these methods in evaluation during debug. Unreal Engine contains a vast of code optimizations which produce different limitations for the debugger. In that case the problem is in the fact that these methods are defined as FORCEINLINE. It leads to missing of these methods in engine binaries, so that the debugger says "no member named {x} in {y}" while trying to evaluate it.
Visual Studio also can't evaluate these sample methods during debug.
Workaround:
to use wcscmp instead, for example:
on Windows: wcscmp((TCHAR*)SomeFString.Data.AllocatorInstance.Data,TEXT("StaticMeshActor_33"))==0
on Mac/Linux: ((size_t)wcscmp((TCHAR*)SomeStr.Data.AllocatorInstance.Data,TEXT("StaticMeshActor_33"))==0)
It also can be used for Data Breakpoints.
Comments
0 comments
Please sign in to leave a comment.