|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Xlib - Strange location?
My *second* C library question today
So as well as checking out socket programming on OpenBSD, I was looking at X programming. I wanted to test a few examples on the net, all of which tell me to include this files - Code:
#include <X11/Xlib.h> Code:
/usr/X11R6/include I don't mind using the OpenBSD locations, but wouldn't this make the source unportable to other *nixes that have the xlibs in the standard directory? |
|
|||
Quote:
To get it to work under OpenBSD it would have to be instead - Code:
#include "/usr/X11R6/include" |
|
|||
#include <X11/Xlib.h> is portable, the local version of GCC simply doesn't look in /usr/X11R6, which was the default path on all Unix-like systems prior to the modularization of Xorg R7, OpenBSD retains this for portability reasons!
Developers can utilize pkg-config(1) or simply pass the proper -I, -L and -l arguments to GCC. Please do a little more research before posting. |
|
||||
It's also possible to do things like: #include <Xlib.h> and gcc -I/usr/X11R6/include/X11 .... or where ever the path to Xlib.h and friends are.
If <X11/Xlib.h> is portable enough when adjusted for the correct paths, then it's likely better to use that; as you've been directed.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange lib problem | mururoa | FreeBSD General | 3 | 1st August 2009 07:34 AM |
The location of Backup files from portupgrade | paul-lkw | FreeBSD Ports and Packages | 4 | 21st September 2008 05:53 PM |
Location for CVSup supfile. | bsdnewbie999 | OpenBSD General | 5 | 26th June 2008 11:32 AM |
location for wpi-firmware-.tgz | bsdnewbie999 | OpenBSD General | 1 | 18th June 2008 04:20 AM |
Both versions installing in same location, & can't delete | jaymax | FreeBSD General | 5 | 9th June 2008 06:25 PM |