开发者

How do I instruction ld to look for additional directories with c?

开发者 https://www.devze.com 2023-03-22 13:19 出处:网络
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:

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.

0

精彩评论

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