Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make: undefined reference to symbol 'dlclose@@GLIBC_2.2.5' #4

Open
sincere-music opened this issue Jan 8, 2018 · 3 comments
Open

Comments

@sincere-music
Copy link

I tried compiling lily-q on a Ubuntu 16.04 live system, installed the dependencies (libasound2-dev and libreadline-dev; gcc was already installed, version 4:5.3.1-1ubuntu1). Make fails with this log:
make-lily-q.log

@palestrina
Copy link
Owner

Hi Simon,

As far as I can tell, it looks like a problem with libdl (to do with dynamic linking). I am able to reproduce this problem:
/usr/bin/ld: LuaSource/liblua.a(loadlib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
...by leaving -ldl out of my Makefile. It’s a bit of a mystery why the problem happens with liblua.a, because I’m trying to include Lua statically. At any rate for me (Debian & Fedora), compilation seems to work with a “good” version of libdl.

Another alternative is to place -ldl later in the process (in the Makefile):

	gcc -ILuaSource -LLuaSource -o lq LilyQuick.c -lasound \
		-lpthread -llua -ldl -lm

From the tiny bit I know about linking (mostly that it is completely unintuitive), this might help. Don’t forget Makefiles need real tabs as indentation. Good luck!

@sincere-music
Copy link
Author

sincere-music commented Jan 10, 2018 via email

@palestrina
Copy link
Owner

Fair enough. I got around to releasing Version 1.0, which has the change in the Makefile. See if it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants