Answer the question
In order to leave comments, you need to log in
Undefined symbol when loading a library via dlopen?
I'm trying to write a plugin for one program that would add support for Redis. It needs to write several functions that will be called. I use github.com/redis/hiredis for this.
If you just build hiredis, then everything works fine. If I collect so, then when I try to load through dlopen, I get an error undefined symbol: redisConnectWithTimeout.
The problem is most likely in how I compile this case: it gcc -I./ -fPIC -shared example.c -o plugin.so
nm plugin.so
shows the following:
U redisConnectWithTimeout
U redisFree
Answer the question
In order to leave comments, you need to log in
Try adding the -rdynamic flag when compiling the plugin. With what flags is dlopen called?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question