Re: Problems with undefined reference errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12 Jun 2003, Bill Baker wrote:

>Date: 12 Jun 2003 14:02:25 -0400
>From: Bill Baker <bill_chris@xxxxxxxxxxxxx>
>To: xfree86-list@xxxxxxxxxx, xfree86@xxxxxxxxxxx
>Reply-To: xfree86-list@xxxxxxxxxx
>Content-Type: text/plain
>Subject: Problems with undefined reference errors
>
>Ever since I upgraded to Red Hat 9, I have been having problems
>compiling programs.  I tried searching the web, but have had no luck so
>far.  I have a custom build of XFree86 (4.3.0-3) installed that I built
>from the source RPM under Red Hat 8.0, however this problem did not
>start showing up until I upgraded to Red Hat 9.  The problem is that I
>keep getting "undefined reference" errors from certain X libraries. 
>Here is an example of a small C program I tried to compile just today
>under gcc-3.2.2-5:
>
>#include <X11/extensions/XTest.h>
>#include <X11/keysym.h>

You're not including the proper X headers.

TTYL


>int main(void)
>{
>        Display* disp = XOpenDisplay(NULL);
>        if (disp == NULL) return 1;
>        XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock),
>True,CurrentTime);
>        XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock),
>False,CurrentTime );
>        XCloseDisplay(disp);
>        return 0;
>}
>
>The command I used to compile it was:
>
>gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock numlock.c -lX11
>-lXtst
>
>And the output was:
>
>/tmp/ccNbDMZN.o(.text+0x16): In function `main':
>: undefined reference to `XOpenDisplay'
>/tmp/ccNbDMZN.o(.text+0x3c): In function `main':
>: undefined reference to `XKeysymToKeycode'
>/tmp/ccNbDMZN.o(.text+0x5f): In function `main':
>: undefined reference to `XKeysymToKeycode'
>/tmp/ccNbDMZN.o(.text+0x7c): In function `main':
>: undefined reference to `XCloseDisplay'
>/usr/X11R6/lib/libXtst.so: undefined reference to
>`XGetErrorDatabaseText'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XPending'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XextAddDisplay'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XFree'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XextFindDisplay'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XReply'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XDeqAsyncHandler'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XextCreateExtension'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XGetAsyncData'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XEatData'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XFlush'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XSend'
>/usr/X11R6/lib/libXtst.so: undefined reference to `_XRead'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XextRemoveDisplay'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XMissingExtension'
>/usr/X11R6/lib/libXtst.so: undefined reference to `XQueryExtension'
>collect2: ld returned 1 exit status
>
>Any ideas about what's going on?
>
>--Bill
>
>
>_______________________________________________
>xfree86-list mailing list
>xfree86-list@xxxxxxxxxx
>https://www.redhat.com/mailman/listinfo/xfree86-list
>IRC: #xfree86 on irc.redhat.com
>

-- 
Mike A. Harris



_______________________________________________
xfree86-list mailing list
xfree86-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/xfree86-list
IRC: #xfree86 on irc.redhat.com

[Red Hat General]     [Red Hat Watch]     [Red Hat Development]     [Kernel Development]     [Yosemite Camping]

  Powered by Linux