Eu tenho código que carrega a biblioteca dinamicamente. Recebi erros como abaixo depois de executar make
.
aaa.cpp:(.text+0x4ea): undefined reference to 'dlopen'
aaa.cpp:(.text+0x50b): undefined reference to 'dlerror'
aaa.cpp:(.text+0x54e): undefined reference to 'dlsym'
aaa.cpp:(.text+0x560): undefined reference to 'dlerror'
aaa.cpp:(.text+0x56f): undefined reference to 'dlerror'
aaa.cpp:(.text+0x595): undefined reference to 'dlclose'
aaa.cpp:(.text+0x5b8): undefined reference to 'dlsym'
aaa.cpp:(.text+0x5ca): undefined reference to 'dlerror'
aaa.cpp:(.text+0x5d9): undefined reference to 'dlerror'
...
Isso me faz pensar que dl
está faltando. Qual é a melhor maneira de instalar dl
no Ubuntu?
UPD
libc6-dev já está instalado no meu sistema
$ sudo aptitude install libc6-dev
libc6-dev is already installed at the requested version (2.23-0ubuntu9)
libc6-dev is already installed at the requested version (2.23-0ubuntu9)
No packages will be installed, upgraded, or removed.
makefile:
# Options for development
COMPILER = g++
#CFLAGS = -c -Wall -ansi
CFLAGS = -fPIC -c
# Options for release
#CFLAGS = -c -Wall -O
client:
$(COMPILER) $(CFLAGS) c1.cpp -o c1.o
$(COMPILER) -ldl c1.o -o aa
clean:
rm *.o
rm aa