Hi Eric,
Why would one be less portable than the other?
#include <SDL_image/SDL_image.h>
#include "SDL_image.h"
In fact, on MacOS, the second is more trouble. On other platforms
it hardly makes any difference.
Because many package systems that for example you find on Linux will
put SDL_image under <SDL/SDL_image.h>, not <SDL_image/SDL_image.h>.
Package maintainers have total discretion over where they install
components. We don’t have any control over this, nor should we dictate
to a platform/package system how to do their job. (We can give
guidelines, but package maintainers are going to know their trade
better than we do, and if they need exceptions we’re not aware of, so
be it.)
And why keeps the quoted version popping up?
Simple answer: quotes are for user headers, angle brackets are for
system headers. SDL is not technically a system header. Milage will
vary by compiler and installation configuration how much of a pain
this will be if you use the wrong one.
(Trivia: There was a really bad bug under Project Builder/gcc on OS X
10.0-10.2 (or .3) where it was ultra sensitive to quotes/brackets and
if you used paths.)
There is an advantage of using <SDL_image/SDL_image.h>
Compilers on MacOS have an extra trick. If you specify
framework search directories (-framework) then the
#include <SDL_image/SDL_image.h>
has the advantage that you do not have to list anything
in the “Header Search Paths”.
Yes, I am fully aware of this, as I’ve been the unofficial OS X
package maintainer for many years now. As much as I like this
convenience on OS X, as I said, this is not portable.
Oh, and on Linux if SDL_image.h is installed in /usr/include/SDL_image
then you don’t have to add a -I option either. On the other
hand, if you include “SDL_image.h” then you must add
-I/usr/include/SDL_image
(I know, in real life it is installed /usr/include/SDL, but
that’s another story.)
No, that isn’t another story. That is the heart of this story.
It might be
/usr/include/SDL
or
/usr/include
FreeBSD at one time put SDL 1.2 under
/usr/local/include/SDL11 (yes, that’s 11)
-EricOn 8/17/11, Kees Bakker <kees.bakker at xs4all.nl> wrote:
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/