Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to install a libspopc, but when I run the make I get the following output:

cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c session.c
cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c queries.c
cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c parsing.c
cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c format.c
cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c objects.c
cc -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL -c libspopc.c
rm -f libspopc*.a
ar r libspopc-0.9n.a session.o queries.o parsing.o format.o objects.o libspopc.o
ar: creating libspopc-0.9n.a
ranlib libspopc-0.9n.a
ln -s libspopc-0.9n.a libspopc.a
rm -f libspopc*.so
cc -o -shared session.o queries.o parsing.o format.o objects.o libspopc.o
ln -s
cc -o poptest1 -Wall -Wextra -pedantic -pipe -fPIC -Os -DUSE_SSL examples/poptest1.c -L. -lspopc -lssl -lcrypto
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x2d): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x43): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4d): undefined reference to `dlclose'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x8f): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0xe9): undefined reference to `dlerror'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x491): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x570): undefined reference to `dlerror'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x5f1): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x6d0): undefined reference to `dlerror'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x735): undefined reference to `dlclose'
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x817): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x88e): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x8d5): undefined reference to `dlerror'
collect2: ld returned 1 exit status
make: *** [poptest1] Error 1

A quick search suggested that this was due to libdl being unlinked, though this seems unlikely in a distributed library, particularly a seemingly relatively popular one. Could anything else be causing this? And if it is due to an unlinked library, how would I go about fixing it?


share|improve this question

1 Answer 1

up vote 2 down vote accepted

You do not explicity ask to link agaist libdl in the Makefile. You should try if adding in manually resolves this (if it is added automatically could depend on your compiler).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.