[SDL] Where is SDL.h located in OS X Distro ?
hollis at penguinppc.org
Mon Apr 12 20:26:44 PDT 2004
On Apr 12, 2004, at 7:24 PM, Neil Bradley wrote:
>> This is ugly and horrible, of course, adding to the collection of
>> that tends to accumulate on compile commandlines. The correct way to
>> it is as you say: #include <SDL/SDL.h>
> I think you mean:
> #include "SDL/SDL.h"
> <> Means use the default include paths (e.g. -I), "" is explicit and
> ignores them.
You totally lost me there. The *default* include paths are what's there
without any -I arguments. Also, "" does not ignore anything; it just
looks in the current directory before the -I directories (and system
directories). The *only* difference is that "" looks in cwd first. I
hardly see one being "more explicit" than the other. I also don't see
what value "SDL/SDL.h" has unless you plan on having the SDL include
directory in your cwd and you want to use that without any -I arguments
(a bit contrived IMHO).
> I expressly forbid usage of <> in all of my professional
> projects and default include paths unless it's to reference a system
> library. It prevents accidentally picking up a stray .h (yes, it
> and you know exactly what file you're including.
Add the directory dir to the list of directories to be searched for
header files. Directories named by -I are searched before the standard
system include directories.
So even if you have foo/bar.h, /usr/include/bar.h, and -Ifoo in CFLAGS,
you won't pick up /usr/include/bar.h. I guess you're talking about the
accidental case where you don't have -Ifoo in CFLAGS, and that's fine,
but I still don't see how "SDL/SDL.h" is better than <SDL/SDL.h>.
Luckily for you, Apple's gcc/g++ can handle "SDL/SDL.h" in addition to
<SDL/SDL.h>, but I remain baffled by your reasoning. :)
More information about the SDL