#cc/link Xwindow pgms
5 messages in this thread
Is this the proper place to discuss Unix programming???
Presuming that it is … I am attempting to compile and link
some very simple X window programs. I downloaded the
X window development SW into the /usr/src/X … just as the
installation guide instructed me to do.
However, when trying to include <X11/Xlib.h>, cc cant find it.
Also, problems with linking.
I am now explicitly telling it the directories to search:
cc <pgm> – I /usr/src/X/usr/X/include -L /usr/src/X/usr/X/lib \
-lX11
and that seems to almost work. I get link errors stating that
it cant find "getnetpath", "netdir_getbyname", etc.
There must be an esier way. Any help would be appreciated.
Anything I may have blundered in the installation?? This
directory specification seems very messy.
-Jay Pedersen
I don't have a UX system (yet), so I'll have to wing this, and hope this
will help you.
To avoid having to put the explicit include path, create a link in
usr/include to point at the X11 directory in your usr/src/X/usr/X/include
directory. You can do the same thing with the libraries directive by
creating a link in /usr/lib to point to the X11 library in
/usr/src/X/usr/X/lib.
Or you could just copy the files to /usr/include and to /usr/lib,
respectively.
As for the link errors, you probably need to link another library. Possibly
something like libinet.a or libbsd.a Check your /lib and usr/lib
directories.
Hope this helps. Let me know how things turn out.
Steve
Thanks Steve, I will try this out later and let you know
how it goes.
-Jay Pedersen
Steve, thanks again, I got it to work. I needed to link
with libnsl.so, the command got a bit large so I put it
in a script, works like a charm.
Great! I'm glad you got everything to work.
Steve