Demo glitch

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

Regards,

Daniel

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

No, using “SDL.h” is the portable method. See the FAQ.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Actually, no.

#include “SDL.h” is the most portable way to include SDL.hOn Tue, 2003-01-21 at 23:09, Daniel Phillips wrote:

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

I’ve been meaning to ask about this. Sorry if it’s a little off topic.
All the documentation I’ve ever seen on include says that include ""
looks in the including file’s directory, and that include <> should be
used for path searching.

Did I miss something?On Wed, 2003-01-22 at 00:24, Sam Lantinga wrote:

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

No, using “SDL.h” is the portable method. See the FAQ.

-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030122/efa98a8e/attachment.pgp

It is my understanding that #include “foo.h” searches inside user specified
include dir’s, THEN the system include paths. <> goes straight to the
system include paths.

Owen Butler> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Jimmy
Sent: Thursday, 23 January 2003 9:59 AM
To: SDL Mailing List
Subject: Re: [SDL] Demo glitch

I’ve been meaning to ask about this. Sorry if it’s a little off topic.
All the documentation I’ve ever seen on include says that include ""
looks in the including file’s directory, and that include <> should be
used for path searching.

Did I miss something?

On Wed, 2003-01-22 at 00:24, Sam Lantinga wrote:

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

No, using “SDL.h” is the portable method. See the FAQ.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jimmy
Jimmy’s World.org

yep…

<> makes the compiler look in the standard include directories (where
stdio.h etc is).

“” is used for custom include directories (dependant on compiler settings).
If you set /include/sdl (whatever your include path is + /sdl/) to be a
custom include path, “sdl.h” will be found there.

you could do <SDL/SDL.h> IF you put the sdl include directory in the same
directory where stdio.h etc is but depending on OS and personal preferances,
it might not be wise to put the SDL directory there. thats why “sdl.h” is
the way to go, that way its up to the individual where they want the SDL
include directory to reside.

make sense?> ----- Original Message -----

From: jimmy@jimmysworld.org (Jimmy)
To: “SDL Mailing List”
Sent: Wednesday, January 22, 2003 2:58 PM
Subject: Re: [SDL] Demo glitch

Sorry, this isn’t accurate. You will see here:

http://www.lysator.liu.se/c/rat/c8.html#3-8-2

that the ISO committee wimps out and leaves the difference between #include
and #include “filename” as implementation defined, but says that
the implementation should correspond as closely as possible to the original
intention of K&R.

So, pulling my K&R down off the shelf, I see this:

A compiler line of the form

  #include "filename"

causes the replacement of that line by the entire contents of the file
filename. The named file is searched for first in the directory of the
original source file, and then in a swquence of standard places.
Alternatively, a control line of the form

  #include <filename>

searches only the standard places, and not the directoryt of the source
file.

So, to put it simply, the only difference between #include “filename” and
#include is that the second one does not search the directory of
the original source file before it searches other places.

We can then go on to observe that no sane person would put the SDL headers in
the same directory as their project files, and therefore the claim in the FAQ
about the #include “filename” form being more portable is most certainly
wrong.

Finally, it’s not your fault for being confused about this, it’s the fault of
a standardization process that does not think it is important to make the
resulting documents publicly and freely available, so that people will refer
to them when questions like this arise instead of guessing or relying on
lore. Note that the link I supplied is to a “rationale”, not the actual
standard. You can also find “drafts” of the ISO C standard online if you
look hard enough. But to see the standard itself, you have to pay for it,
which sounds like a good idea until you realize that that little obstacle is
enough to keep 99.99% of programmers from ever looking at it, which rather
dilutes the purpose of having a standard in the first place.

Takeaways:

  • the FAQ is wrong in its statement re portability

  • the only difference between the two forms in practice is that the
    quoted form searches the original source directory before searching the
    same places as the other form (and whoever came up with this syntax was
    smoking something).

  • ISO should be publicly funded in its standardization work, and thus
    be able to distribute its work widely to help prevent confusion like
    this.

Regards,

DanielOn Thursday 23 January 2003 00:32, Atrix Wolfe wrote:

yep…

<> makes the compiler look in the standard include directories (where
stdio.h etc is).

“” is used for custom include directories (dependant on compiler
settings). If you set /include/sdl (whatever your include path is + /sdl/)
to be a custom include path, “sdl.h” will be found there.

Gotcha.

Well, I’ve got… a LOT of search and replacing to do.

sigh

I appreciate the answer.On Wed, 2003-01-22 at 18:21, Owen Butler wrote:

It is my understanding that #include “foo.h” searches inside user specified
include dir’s, THEN the system include paths. <> goes straight to the
system include paths.

Owen Butler

-----Original Message-----
From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Jimmy
Sent: Thursday, 23 January 2003 9:59 AM
To: SDL Mailing List
Subject: Re: [SDL] Demo glitch

I’ve been meaning to ask about this. Sorry if it’s a little off topic.
All the documentation I’ve ever seen on include says that include ""
looks in the including file’s directory, and that include <> should be
used for path searching.

Did I miss something?

On Wed, 2003-01-22 at 00:24, Sam Lantinga wrote:

Hi Sam,

In this demo:

http://www.libsdl.org/projects/gtk-demo/

I think you want:

-#include “SDL.h”
+#include <SDL/SDL.h>

No, using “SDL.h” is the portable method. See the FAQ.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jimmy <@Jimmy>
Jimmy’s World.org


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jimmy <@Jimmy>
Jimmy’s World
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030122/b6205721/attachment.pgp