Why is MAC build failing on LOCTEXT_NAMESPACE for UserWidget.h

After building Unreal engine from source on a Mac, I switched to that version, generated xcode project files, built the Xcode project, and then I get ‘LOCTEXT_NAMESPACE’ macro redefined error.

Machine info:
MacOS Monterey
Mac mini (M1, 2020)

Unreal Engine Source v5.03 release

So I created a new mobile project. I didn’t add anything. I just configured iOS settings and then built for iPad Air, and then I got these errors. Is the Mac build for iOS not working yet for UE5?

Okay so I was able to fix it by editing each of the files and undefining previous definitions if previously defined to avoid the errors. After that, I was able to build on my target iOS device.

// start temp fix for macro redefined error
#ifdef LOCTEXT_NAMESPACE
#undef LOCTEXT_NAMESPACE
#endif
// end temp fix for macro redefined error

#define LOCTEXT_NAMESPACE "UMG"
1 Like