Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I followed the steps on this page but when I run make it gives me this error:

/usr/bin/ld: keycode.o: undefined reference to symbol 'XKeycodeToKeysym'
/usr/bin/ld: note: 'XKeycodeToKeysym' is defined in DSO /usr/lib/i386-linux-gnu/libX11.so.6 so try adding it to the linker command line
/usr/lib/i386-linux-gnu/libX11.so.6: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status

`

share|improve this question
    
Have you got all the build dependencies installed, e.g libx11-dev, etc. –  user76204 Apr 13 '13 at 21:21
    
I've just compiled successfully on Xubuntu 12.04; my instructions seem to be fine. Check again whether you have all the build dependencies installed. –  user76204 Apr 13 '13 at 21:28
    
yup, I've got them all. I tried again, and it said the same thing, I also noticed that it was saying this, too: error.h:8:13: warning: 'void error(QString, QString)’ defined but not used [-Wunused-function] –  TheBlackUnicorn Apr 13 '13 at 21:42
add comment

2 Answers

This is an Ubuntu thing, works fine without it in Debian Stable. So might effect Mint too.

Add -lX11 in the Makefile to the LIBS line under the LFLAGS line so it should look like this when your done.

For 64bit:

LIBS = $(SUBLIBS) -L/usr/lib/x86_64-linux-gnu -lXtst -lQtGui -lQtCore -lpthread -lX11

For 32bit:

LIBS = $(SUBLIBS) -L/usr/lib/i386-linux-gnu -lXtst -lQtGui -lQtCore -lpthread -lX11

They changed the way they compiled to be more exact and broke code from what I get. This worked fine with the exact error on 64bit Ubuntu thanks to someone on the web I found. Every time you run the ./config or ./configure it will remake the Makefile and you have to edit it again.

The Keyboard is dead, Long live the Keyboard. :P

share|improve this answer
    
Note: if you are following the Arc Synthesis OpenGL tutorial, you might get the error described in the original question on Ubuntu. To fix it, just open the target makefile (such as Tut 01 Main.make), go down to the LIBS section under debug and release, and add -lX11. That should fix it. –  InkBlend Nov 27 '13 at 18:07
add comment

This looks more like a problem with your X11 library.

Just reinstall X11 library

sudo apt-get autoremove libx11-6

and then

sudo apt-get install libx11-6

share|improve this answer
    
I did that, and then make and then this happened usr/lib/i386-linux-gnu -lXtst -lQtGui -lQtCore -lpthread /usr/bin/ld: keycode.o: undefined reference to symbol 'XKeycodeToKeysym' /usr/bin/ld: note: 'XKeycodeToKeysym' is defined in DSO /usr/lib/i386-linux-gnu/libX11.so.6 so try adding it to the linker command line /usr/lib/i386-linux-gnu/libX11.so.6: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make: *** [qjoypad] Error 1 –  TheBlackUnicorn Apr 13 '13 at 22:05
    
Did that solve your problem? –  thefourtheye Apr 13 '13 at 22:06
    
No, it did not. –  TheBlackUnicorn Apr 13 '13 at 22:15
    
Wasn't trying to sound rude there, I had to fulfill the 15 character minimum –  TheBlackUnicorn Apr 13 '13 at 22:15
    
No probs... I updated the answer now, can you please try that? –  thefourtheye Apr 13 '13 at 22:20
show 12 more comments

Your Answer

 
discard

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.