0

I have a scenario were i have to download 2 shared library(libbase, libderived) during runtime and load those libraries and invoke a method inside one library. I am able to load it and invoke the method, but dynamic_cast inside the library does not work(it returns null pointer).

If i keep those libs as native dependencies in my android app(including it as jni in the app - libs getting added to lib folder of apk) then dynamic_cast works as expected.

But runtime loading of downloaded libs using system.load(...) or dlopen(...) causes dynamic_cast to return null pointer.

My goal is that dynamic_cast should work for my scenario. Any help would be appreciated.

Botje
  • 26,269
  • 3
  • 31
  • 41
A.G
  • 3
  • 6
  • Does this help: https://stackoverflow.com/questions/2351786/dynamic-cast-fails-when-used-with-dlopen-dlsym – gerum Oct 17 '22 at 20:32
  • @gerum thanks for the link, but unfortunately that did not solve my problem. – A.G Oct 18 '22 at 09:54

0 Answers0