You are not logged in.
Pages: 1
HI,
I'm trying to compile and install a program from source but I keep getting this error:
/usr/bin/ld: obj/linux/system.o: undefined reference to symbol 'XQueryKeymap'
/usr/bin/ld: note: 'XQueryKeymap' is defined in DSO /usr/lib/libX11.so.6 so try adding it to the linker command line
/usr/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
Is their any way to fix this. I'm on x86_64.
Last edited by sethradio (2013-01-25 05:28:12)
And lo, it came to pass, that the neophyte encountered the Beplattered One and humbly posed the question, "Oh great master, is it a sin to use vi?" And St. IGNUcius didst thus reply unto him, "No, my young hacker friend, it is not a sin. It is a penance."
Offline
Yes, as the message instructs, add it to the linker line (or compiler). For example:
gcc -o program source.c -lX11
What are you trying to compile? Doesn't it come with a Makefile? And did you check the AUR for it?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Online
Yeah, it's in the AUR, but not the latest version. Compiling the AUR package has the same problem. I fixed it by editing the makefile, and adding to the linker command line: -lX11 and -ldl. On other distros that isn't needed for some reason.
And lo, it came to pass, that the neophyte encountered the Beplattered One and humbly posed the question, "Oh great master, is it a sin to use vi?" And St. IGNUcius didst thus reply unto him, "No, my young hacker friend, it is not a sin. It is a penance."
Offline
On other distros that isn't needed
They probably don't have --as-needed as default in CFLAGS.
Offline
Pages: 1