Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of library dl in gcc

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?

like image 761
Dzung Nguyen Avatar asked Oct 02 '13 20:10

Dzung Nguyen


People also ask

What is a DL library?

Dynamically loaded (DL) libraries are libraries that are loaded at times other than during the startup of a program. They're particularly useful for implementing plugins or modules, because they permit waiting to load the plugin until it's needed.

What is DL library in C++?

Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems.

What are library files in Linux?

A Library in Linux A library is a collection of pre-compiled pieces of code called functions. The library contains common functions and together, they form a package called — a library. Functions are blocks of code that get reused throughout the program. Using the pieces of code again in a program saves time.

How libraries work in Linux?

Shared libraries are the most common way to manage dependencies on Linux systems. These shared resources are loaded into memory before the application starts, and when several processes require the same library, it will be loaded only once on the system. This feature saves on memory usage by the application.


1 Answers

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)

like image 168
Chris Stratton Avatar answered Sep 19 '22 03:09

Chris Stratton