Meaning of library dl in gcc

梦想与她 提交于 2019-12-21 03:23:13

问题


I'm checking a makefile, and see that the libraries used are:

LIBS = -lcppunit -ldl

lcppunit is the unit testing library. What is ldl then?


回答1:


libdl is the dynamic linking library.




回答2:


This is the interface to the dynamic loader, which provides a client program with ability to do things such as explicitly load other libraries, lookup symbols within, etc.

Most programs do not need to do such things explicitly, since the linker does what is needed to enable ordinary usage of shared libraries while loading the program and libraries themselves. However programs that are clever or try to explore and manipulate the dynamic linking system and its data need explicit access. Some of the capabilities are distantly similar to reflection in Java, though with major limitations (such as applying only to dynamic symbols)




回答3:


libdl is the dynamic link library used in plugin architectures with well defined interfaces. At least that's how I've seen it used.



来源:https://stackoverflow.com/questions/19146525/meaning-of-library-dl-in-gcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!