How do I instruction ld to look for additional directories with c?
I'm asking the solution in c
, NOT command line options.
The reason I'm sure it exists is that Apache can be i开发者_高级运维nstructed to loaded .so
dynamically:
load modules/mod_perl.so
UPDATE
Isn't it too inefficient if I need to search with dlsym
one by one?
If you want to load your own modules dynamically, study the dlopen
/dlsym
family of functions. That's what Apache uses to load its modules. man dlopen
has all the information.
If you want to link against shared libraries, you must use linker command line options to specify where these libraries are. Otherwise your program will not be able to execute. No amount of C programming can help a program that won't even start.
精彩评论