[prev in list] [next in list] [prev in thread] [next in thread] 

List:       debian-user
Subject:    Re: idiot's question on Xlib programming
From:       Ludovic Paquet <paquet () donald ! sp2mi ! univ-poitiers ! fr>
Date:       1999-08-04 7:36:46
[Download RAW message or body]

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
huixf@tonghua.com.cn wrote:
<blockquote TYPE=CITE>I write a simple program but can't compile it. Below
is the program:
<p>#include &lt;Xlib.h>
<br>main()
<br>{Display *d=XOpenDisplay(NULL);
<br>&nbsp; if(d==NULL)
<br>&nbsp;&nbsp; {printf("can't open display\n");exit(0);}&nbsp; XCloseDisplay(d);
<br>}
<p>I use "gcc -I/usr/X11R6/include/X11 xhi.c" to complie it and get the
following message:
<p>/tmp/cca002281.o: In function `main':
<br>/tmp/cca002281.o(.text+0x9): undefined reference to `XOpenDisplay'
<br>/tmp/cca002281.o(.text+0x45): undefined reference to `XCloseDisplay'
<p>What's the problem? Please reply to huixf@tonghua.com.cn because I will
leave the list in a minute.
<p>--
<br>Unsubscribe?&nbsp; mail -s unsubscribe debian-user-request@lists.debian.org
&lt; /dev/null</blockquote>

<p><br>You can try to compile with "gcc -I/usr/X11R6/include&nbsp; \
                <b>-L/usr/X11R6/lib/
-lX11</b> xhi.c"
<p>The source code is:
<br>&nbsp;
<br>&nbsp;#include &lt;<b>X11</b>/Xlib.h>
<br>main()
<br>{Display *d=XOpenDisplay(NULL);
<br>&nbsp; if(d==NULL)
<br>&nbsp;&nbsp; {printf("can't open display\n");exit(0);}&nbsp; XCloseDisplay(d);
<br>}
<p>It works on my computer
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
<pre>--&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
\\\////// &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
/ _&nbsp;&nbsp; _ \ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
(&nbsp; O&nbsp;&nbsp; O&nbsp; ) ===============oOOO=====(_)=====OOOo===============
PAQUET Ludovic

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e-mail : \
paquet@sp2mi.daisy.univ-poitiers.fr \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; telephone : 05-46-88-41-80 \
===========================Oooo.=================== \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
.oooO&nbsp;&nbsp; (&nbsp;&nbsp; ) \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
(&nbsp;&nbsp; )&nbsp;&nbsp;&nbsp; ) / \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
\ (&nbsp;&nbsp;&nbsp; (_/ \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
\_)</pre> &nbsp;</html>


-- 
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic