By DubiousPusher

2019-02-05 18:20:52 8 Comments

Unreal Engine has a plugin for integrating with OpenCV. Currently that plugin works on Windows. I'm trying to modify this plugin to work on Linux. I've worked through many issues but I have one I can't resolve.

When I try to build the plugin without modification, I get this error:

cannot use typeid with -fno-rtti

The error is from a file any.h which is a part of the OpenCV FLANN feature set and appears to have been copied over from boost.

To address this, I enable RTTI for the module of the plugin I'm building. Unfortunately, this leads to load time errors like the following:

dlopen failed: /home/lvl-dev/Projects/TestOpenCVModules/Plugins/OpenCVLensDistortion/Binaries/Linux/ undefined symbol: _ZTI7UObject

ModuleManager: Unable to load module '/home/lvl-dev/Projects/TestOpenCVModules/Plugins/OpenCVLensDistortion/Binaries/Linux/' because the file couldn't be loaded by the OS.

As far as I can tell, this is because Unreal builds by default with '-fno-rtti'. And now the Unreal objects in my plugin expect RTTI information to be available for the Unreal objects when my libraries are loaded at runtime. I found you can pass RTLD_LAZY to dlopen(), which I thought would address this, but when I looked at the source it was already using it.

The next obvious thing is to just build everything with RTTI but I've been unable to accomplish this. I've seen on some forums that building Unreal with RTTI is possible after version 4.15 or so. However, when I've tried to build the engine with RTTI I get errors from attempting to link compiled third party dependencies that are now incompatible with Unreal (WebRTC for example). I'd really rather not work my way through building every Unreal dependency from source myself.

Strangely nothing is done to handle this issue on Windows. It seems the Microsoft linker and runtime handles both RTTI and non-RTTI definitions of the object without issue.

Is there a straight forward way to build and successfully run wtih C++ RTTI enabled?

Is there a way to mix RTTI and non-RTTI objects, as Microsoft seems to do, and suppress the link errors from the runtime?

Is there some solution I'm not considering?


Related Questions

Sponsored Content

1 Answered Questions

Is there a plugin example for SKSE Special Edition?

  • 2018-06-17 08:31:09
  • user91018
  • 386 View
  • 0 Score
  • 1 Answer
  • Tags:   c++ skyrim-modding

1 Answered Questions

[SOLVED] CompileFromFile syntax error upon compilation

1 Answered Questions

[SOLVED] Runtime Java Module Generation for Game Plugins

1 Answered Questions

[SOLVED] Why does UE crash when I spawn a tile actor like this?

2 Answered Questions

Why am I having these errors, when opening my Unity project in Ubuntu?

  • 2015-10-10 11:06:41
  • Max
  • 323 View
  • -1 Score
  • 2 Answer
  • Tags:   unity linux

1 Answered Questions

[SOLVED] Create a WebGL native plugin

0 Answered Questions

How does Visual Studio integrate with Unreal Engine better than Code::Blocks does?

2 Answered Questions

[SOLVED] Unity Plugin DLLNotFoundException

  • 2010-12-16 22:50:39
  • Dewayne
  • 6427 View
  • 2 Score
  • 2 Answer
  • Tags:   c++ unity

2 Answered Questions

[SOLVED] Debugging/Logging Techniques for End Users

  • 2011-03-05 15:23:41
  • James B
  • 1095 View
  • 4 Score
  • 2 Answer
  • Tags:   c++ debugging

1 Answered Questions

[SOLVED] Custom Pan/Tilt Input device and Unreal Gaming Engine

  • 2012-12-27 00:57:19
  • Hairgami_Master
  • 816 View
  • 0 Score
  • 1 Answer
  • Tags:   unreal

Sponsored Content