2011-11-29 73 views
3

我试图编译RemotePad服务器上的Linux Mint的12,并在我收到以下错误时:未定义参考编译RemotePad


gcc -lXtst -lX11 -lm -o remotepad remotepad.o ucs2keysym.o 
remotepad.o: In function `handleKeyEvent': 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:369: undefined reference to `XKeysymToKeycode' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:371: undefined reference to `XTestFakeKeyEvent' 
remotepad.o: In function `simulateKeyWithUnichar': 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:379: undefined reference to `XKeysymToKeycode' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:399: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:404: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:403: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:401: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:389: undefined reference to `XKeysymToKeycode' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:394: undefined reference to `XKeysymToKeycode' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:398: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:396: undefined reference to `XTestFakeKeyEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:391: undefined reference to `XKeysymToKeycode' 
remotepad.o: In function `handleKeyEvent': 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:365: undefined reference to `XBell' 
remotepad.o: In function `main': 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:125: undefined reference to `XOpenDisplay' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:130: undefined reference to `XTestQueryExtension' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:143: undefined reference to `XCreateWindow' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:148: undefined reference to `XDisplayKeycodes' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:150: undefined reference to `XGetKeyboardMapping' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:194: undefined reference to `XGetWindowAttributes' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:317: undefined reference to `XGetWindowAttributes' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:302: undefined reference to `XFlush' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:259: undefined reference to `XTestFakeButtonEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:260: undefined reference to `XTestFakeButtonEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:284: undefined reference to `XTestFakeButtonEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:233: undefined reference to `XTestFakeRelativeMotionEvent' 
/home/joe/Downloads/RemotePad Server/X11/remotepad.c:126: undefined reference to `XDisplayName' 
collect2: ld returned 1 exit status 
make: *** [remotepad] Error 1 

我GOOGLE和它说以确保Xsts包安装了我所做的。


/home/joe $ ls /usr/lib/libXtst* 
/usr/lib/libXtst.a /usr/lib/libXtst.so /usr/lib/libXtst.so.6 /usr/lib/libXtst.so.6.1.0 

回答

6

最好用:gcc remotepad.o ucs2keysym.o -o remotepad -lXtst -lX11 -lm进行参数排序。未定义的引用绝对在X11库中。也许加上-L/usr/X11/lib - 或者找到X库的地方。

+0

工作!谢谢。 joe @ joe-Inspiron-1720〜/下载/ RemotePad Server/X11 $ gcc remotepad.o ucs2keysym.o -o remotepad -lXtst -lX11 -lm -L/usr/lib – user1071182

+0

no go。做完这些之后,我运行make并获取错误信息:make:“全部”无法完成。 –