[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 <Xlib.h>
<br>main()
<br>{Display *d=XOpenDisplay(NULL);
<br> if(d==NULL)
<br> {printf("can't open display\n");exit(0);} 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? mail -s unsubscribe debian-user-request@lists.debian.org
< /dev/null</blockquote>
<p><br>You can try to compile with "gcc -I/usr/X11R6/include \
<b>-L/usr/X11R6/lib/
-lX11</b> xhi.c"
<p>The source code is:
<br>
<br> #include <<b>X11</b>/Xlib.h>
<br>main()
<br>{Display *d=XOpenDisplay(NULL);
<br> if(d==NULL)
<br> {printf("can't open display\n");exit(0);} XCloseDisplay(d);
<br>}
<p>It works on my computer
<br>
<br>
<br>
<pre>--
\
\\\////// \
/ _ _ \ \
( O O ) ===============oOOO=====(_)=====OOOo===============
PAQUET Ludovic
e-mail : \
paquet@sp2mi.daisy.univ-poitiers.fr \
\
telephone : 05-46-88-41-80 \
===========================Oooo.=================== \
\
.oooO ( ) \
\
( ) ) / \
\
\ ( (_/ \
\
\_)</pre> </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