Unreal 4.24 'USE_RTTI' is not defined as a preprocessor macro

Trying to upgrade a plugin for use in 4.24 and I’ve gotten to this point where I get

games\ue_4.24\engine\source\thirdparty\physx3\apex_1.4\include\ApexDefs.h(54):
error C4668: ‘USE_RTTI’ is not defined
as a preprocessor macro, replacing
with ‘0’ for ‘#if/#elif

I’ve gone in and added the bUseRTTI = true to every Build.cs I have but the issue persists.

I’m not sure what is going on to cause USE_RTTI to not be defined.

I’ve also regenerated project files after deleting Intermediate folders and Binaries for both plugin and project.

The solution was posted here:
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1701696-stuck-on-uninformative-error

Finally managed to solve the issue, it was crying because I did #include “Actor.h” instead of #include “GameFramework/Actor.h”

6 Likes

Thank you very much!

Thanks! It helped me when I try to upgrade to 4.27

1 Like

For anyone visiting this page and not seeing any responses, the solution for me was to check the imports for standard c++ libraries - in my case I was importing the standard string library which was causing problems.

2 Likes

Thank you, that was the reason.
In my case it was thanks to Rider that sometimes feels like adding headers without asking (It’s not the first time that it happens and it’s so frustrating, because you don’t know in which file it’s happening!)