RTTI failed compiling when enabled for 4.23 linux

got "undefined reference to ‘typeinfo for FTickerObjectBase’ error under linux.
linux os 14.04.

1 Like

How did you enable RTTI, for one module or for the whole engine?

for the whole engine, enable it by setting bUseRTTI to true in ModuleRules.cs. it compiles fine under UE4.21 but failed for UE4.23.
Both 4.21 and 4.23 are clean code I pulled from github.

ok, it failed on ubuntu 18.04 too.

That class needs a ENGINE_VTABLE export most likely. We’ll look into this.

so, adding ENGINE_VTABLE for this class will fix the compiling issue? comparing with 4.21, I didn’t see any changes of the definition of that file.

4.23 by default hides symbols that are not exported explicitly, while 4.22 and earlier made them all visible by default, so the change is in compiler settings, not the source itself.

got it, I’ve add CORE_VTABLE to the definition of the class, compiling it right now.

is there a easy way that I could make them all visible by default as 4.22 ?

You can edit LinuxToolChain.cs and remove the if with CompileEnvironment.bHideSymbolsByDefault, then recompile the whole engine. However, having all symbols visible makes symbol resolution slower and also creates a potential for the symbol collision, which is why they are no longer visible by default.

I can see that, but at least I can get it work before epic fix the rtti issue. thanks

still got undefined reference to `typeinfo for buzz::XmppTask’ error when set bHideSymbolsByDefault to false. where should I change to get rid of this compiling error? this is from 3rd party folder.

We also found that yesterday. Sorry, it seems that 4.23 is not possible to compile the whole engine with RTTI on (which is not supported anyway). If you need RTTI for a specific third party module only maybe you can enable it just for that one? You will need a shim module to communicate with that third party lib (similarly to OpenExrWrapper module)

EDIT: if you still want to compile the whole engine with RTTI you will need to either disable or rebuild WebRTC. You can disable it by editing XMPP.Build.cs and setting TargetPlatformSupportsJingle = false for Linux

thanks, btw, are you guys going to fix the compiling error when RTTI set to true?

how to fix the link error of "undefined reference to ‘XML_Parse’?

do you get this error when turn on RTTI? I check the code, seems expat didn’t add to build under linux.

Not for 4.23.x at this point, since changes would go against bincompat rules (i.e. can break compatibility with the plugins) :confused:

Perhaps my idea to disable just Jingle didn’t work out of the box. You can try disabling XMPP module in general.

But a better route is to not compile the whole engine with RTTI, and instead set RTTI to true just for the module (in its Build.cs) that actually needs dynamic_cast<> and see if you can get away with that (you may if you don’t subclass engine classes in that module). If your module has both dynamic_cast<> and also subclasses engine classes, you’ll need split that into two modules and only have RTTI enabled for the one that uses dynamic_cast<>s.

I’ll give a try, thanks for the suggestion.

I was under the impression that RTTI could only be enabled at the Target level ("bFoceEnableRTTI = true). We used to do this for our Editor target, but I believe somewhere around 4.21 y’all made it so that wouldn’t work anymore. If it was turned on anywhere, it had to be turned on everywhere (or use a “unique” build environment, which appeared to require cooked content to run).

Has this changed? Will look into setting it at the Build.cs level.

Edit: sho’ 'nuff stuff! bUseRTTI = true is available at the Build.cs level. Updating our codebase now! Thanks!