1

I'm trying to load a module library via dl in such way, that the module can access globals from the main application. How is that possible to do?

I get an error message from dlopen saying library/name.so: undefined symbol: .... The only flag used is: RTLD_NOW.

The module itself is build with libtool with -module -avoid-version.

viraptor
  • 33,322
  • 10
  • 107
  • 191

1 Answers1

0

The answer is: use -Wl,--export-dynamic when linking the main binary, so all symbols are automatically exported to the loaded libraries.

Same question, just asked differently: Receive "undefined symbol" error when loading library with dlopen

Community
  • 1
  • 1
viraptor
  • 33,322
  • 10
  • 107
  • 191