You are not logged in.

#1 2013-01-24 19:44:03

sethradio
Member
From: /dev/null
Registered: 2012-01-16
Posts: 53
Website

[SOLVED] LibX11 problem

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

#2 2013-01-24 21:16:58

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,810
Website

Re: [SOLVED] LibX11 problem

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?


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2013-01-25 05:27:48

sethradio
Member
From: /dev/null
Registered: 2012-01-16
Posts: 53
Website

Re: [SOLVED] LibX11 problem

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

#4 2013-01-25 06:54:25

brebs
Member
Registered: 2007-04-03
Posts: 3,427

Re: [SOLVED] LibX11 problem

sethradio wrote:

On other distros that isn't needed

They probably don't have --as-needed as default in CFLAGS.

Offline

Board footer

Powered by FluxBB