Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the library for 'dlsym'

I am getting this linker error:

system/core/libacc/tests/main.cpp:42: error: undefined reference to 'dlsym'

Can you please tell me where is the library on ubuntu 9.10 which contains the library for 'dlsym'?

Thank you.

like image 538
hap497 Avatar asked Feb 02 '10 17:02

hap497


People also ask

What is dlsym in c++?

dlsym() — Obtain the address of a symbol from a dlopen() object.

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.

How does dlsym works?

The dlsym() function shall obtain the address of a symbol defined within an object made accessible through a dlopen() call. The handle argument is the value returned from a call to dlopen() (and which has not since been released via a call to dlclose()), and name is the symbol's name as a character string.


1 Answers

From the dlsym(3) man page:

#include <dlfcn.h>

  ....

Link with -ldl.
like image 91
Ignacio Vazquez-Abrams Avatar answered Nov 15 '22 13:11

Ignacio Vazquez-Abrams