[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
RE: X Programming prob...
- Subject: RE: X Programming prob...
- From: Shashank Banerjee <shashankb@xxxxxxxxxxx>
- Date: Tue, 22 Jun 1999 11:26:52 +0530
Karthik,
Well the problem here is on unreferenced functions which means that the
libraries have not been referenced.
When you use the -l (small letter 'L') option, you specify the library
to use. While with -L (capital letter L) you give the path, where this
library is to be found.
Even though you have specified the path correctly in the second case
with the use of -L (which is partially correct), you have not specified
the library to be used while linking.
So this is how you go about it...
$ gcc -L /usr/X11R6/lib -l X11 -l Xmu -l Xt -g -I /usr/include -o Xhello
Xhello.c
(Note: The the symbols before X11, Xmu and Xt are small caps 'L' not
large caps 'i' and before /usr/include is large caps - 'i' )
Regards,
__________________________________________________________________
Shashank Banerjee
Software Consultant, Communications Division
DCM Data Systems
Vikrant Towers, 4, Rajendra Place, NEW DELHI - 110 008, INDIA
Ph: +91-11-5719967-76/E-mail: shashankb@xxxxxxxxxxx
Web Site: http://www.dcmds.com
>-----Original Message-----
>From: Karthik K H [SMTP:karthik_kh@xxxxxxxxxxxx]
>Sent: Tuesday, June 22, 1999 1:57 AM
>To: linux-india@xxxxxxxxx
>Subject: X Programming prob...
>
>HI ,
> I am facing a problem ( which I think maybe specific to Linux ).
> I have written a simple X Windows program to test my new installation
>of RHL5.2
>When I try to compile it with
>"gcc -g -I/usr/include -I/usr/X11R6/include
>-l/usr/X11R6/lib/Xt -l/usr/X11R6/lib/Xmu
>-l/usr/X11R6/lib/X11 XHello.c "
>
>I get an error saying "ld cannot open file /usr.../Xt
>though the lib files are present there.
>
>How ever when i replace all the "-l" options with a single one like
>"-L/usr/X11R6/lib"
>I get the following message
>"/tmp/cca005521.o : In function main
>/tmp/cca005521.o(.text+0x9):
> Undefined reference to XOpenDisplay
> Undefined reference to XCreateWindow
> Undefined reference to XCreateGC .....
> and so on.
>
>But the whole thing works perfectly well with the same commands on
>AIX/Solaris with out change.
>
>Though I have written a lotta X pgms earlier I have not faced this
>problem.
>Can anyone check out on this ?
>My directory locations are pretty much default.
>/usr/include
>/usr/lib
>/usr/X11R6/include
>/usr/X11R6/lib
>
>cheers,
>Karthik K H
>
>
>
>
>_________________________________________________________
>Get your free @grabmail.com address at http://www.grabmail.com
>
>
>
>
>
>
>powered by OutBlaze
>--------------------------------------------------------------------
>For more information on Linux in India visit
>http://www.linux-india.org/
>Linux India is NOT a forum for Microsoft/India/Pakistan/US/UK bashing.
>Flame baits will not be tolerated. If you can appreciate satire read
>http://www.templetons.com/brad/emily.html
- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
Linux India is NOT a forum for Microsoft/India/Pakistan/US/UK bashing.
Flame baits will not be tolerated. If you can appreciate satire read
http://www.templetons.com/brad/emily.html
------------------------------
End of Linux India Digest V1 #61
********************************
--------------------------------------------------------------------
To unsubscribe send an email to majordomo@xxxxxxxxx with the word
'unsubscribe linux-india-digest' (without the quotes) in the body
of the email.