CompuServe Thread

#cc/link Xwindow pgms

5 messages in this thread
#15542From: Jay G PedersenOct 14, 1991 11:48 PM
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
#15565From: Marlene Zenker/SYSOPOct 15, 1991 7:44 PM
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
#15578From: Jay G PedersenOct 15, 1991 10:00 PM
Thanks Steve, I will try this out later and let you know how it goes. -Jay Pedersen
#15584From: Jay G PedersenOct 15, 1991 11:59 PM
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.
#15601From: Marlene Zenker/SYSOPOct 16, 1991 4:56 PM
Great! I'm glad you got everything to work. Steve