Download

TEXT Macro on OSX/IOS

When compiling on Xcode 6.2 with Unreal 4.7.2 I get this error while compiling my sources :

MyCharacter.cpp:390:67: error: ISO C++11 does not allow conversion from string literal to ‘TCHAR *’ (aka ‘wchar_t *’) -Werror,-Wc++11-compat-deprecated-writable-strings]
FAnimNode_Base * Node = GetAnimNodeSequencePlayer( A->RootNode, TEXT( “MyAnimName” ) );

How do I fix this issue as the engine seemed to compile just fine. The target configuration is “ProjectEditor - Mac -> Mac”

Is GetAnimNodeSequencePlayer a method you added? What is the signature for it?

My guess would be that you forgot a const on the TCHAR* argument for the method, and the warning is saying (somewhat indirectly) that you can’t pass a string literal as a non-const parameter.

Cheers,
Michael Noland

Yep, that was it, I had my own functions wanting TCHAR* and switching to const TCHAR* fixed it. However, I still get errors trying to build UE4 for iOS. For the Mac it builds ok though. What exactly should be the target for iOS builds in Xcode though ? I chose #ProjectName - iOS -> User’s iPad(my device plugged in), is this incorrect ?. There’s also UE4Game - iOS, UE4 Client, UEXcodeHelper, etc.

ProjectName - IOS -> User’s iPad is the correct one. UE4Game is for content-only projects.

-Pete