开发者

Dynamic loading and symbols sharing

开发者 https://www.devze.com 2022-12-19 07:41 出处:网络
I\'m trying to load a module library via dl in such way, that the module can access gl开发者_如何学Goobals from the main application. How is that possible to do?

I'm trying to load a module library via dl in such way, that the module can access gl开发者_如何学Goobals 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消