Loading ...
Sorry, an error occurred while loading the content.
 

[blug-prog] Re: SDL lib

Expand Messages
  • ranjit_mathew
    ... From the SDL General FAQ at: http://www.libsdl.org/faq/FAQ-General.html#GENERAL_INCLUDE ... Q: Do I #include or ? A: The most portable
    Message 1 of 10 , Mar 1, 2002
      > > A minor portability note: you should #include "SDL.h" and
      > > not "SDL/SDL.h" as another poster has said.
      >
      > Well, I suggested this since I could see that the original poster
      > was new to such stuff. I have not been able get SDL programs
      > working with # include "SDL.h" . Apparently it requires some makefile
      > magic.

      From the SDL "General FAQ" at:

      http://www.libsdl.org/faq/FAQ-General.html#GENERAL_INCLUDE

      ------------------------ 8< --------------------------
      Q: Do I #include <SDL.h> or <SDL/SDL.h>?
      A: The most portable way to include SDL headers is
      to use quotes around the header name:
      #include "SDL.h"
      ------------------------ 8< --------------------------

      And the "makefile magic" you're referring to is to
      specify the right compiler option to GCC, viz.
      "-I/usr/local/include/SDL" if your SDL header files
      are in /usr/local/include/SDL.


      > > BTW, it is generally not a good idea to copy header files
      > > from every library you encounter into your /usr/include -
      > > this location is intended for "core" header files (libc,
      > > math, kernel, etc.)
      > >
      >
      > IIRC, sdl rpm by default now installs into /usr/xx. Earlier
      > it used to install in /usr/local/xx. And If somebody is a
      > hobbyist, and has a home computer, it is far easier to stuff
      > everything in /usr/*.

      I think Mosfet (of KDE fame) has just the right rant
      for you - see "Rage against the File System standard":

      http://www.mosfet.org/fss.html


      > And btw, if you look at *your* system, you
      > will find stuff like python, kaffe in /usr/include.

      Nope, not at all - my system has that greatest of
      distros, Slackware, whose maintainers have the good
      to keep unrelated things separate and away from
      each other. :-P


      > No point in being religious about such things;

      Oh yes there is: "braces on the next line", "vi is
      the greatest", "KDE over GNOME", "C over any other
      programming language", "Slackware over RH/Mandrake",
      etc. etc.

      Just kidding!

      Ranjit.
    • Pallav Nawani
      ... I knew that. I nevertheless suggested using include since I don t believe including SDL.h is more portable. ... Means the same thing. If you
      Message 2 of 10 , Mar 1, 2002
        On Fri, 1 Mar 2002, ranjit_mathew wrote:

        > > > A minor portability note: you should #include "SDL.h" and
        > > > not "SDL/SDL.h" as another poster has said.
        > >
        > > working with # include "SDL.h" . Apparently it requires some makefile
        > > magic.
        >
        > >From the SDL "General FAQ" at:
        >
        > http://www.libsdl.org/faq/FAQ-General.html#GENERAL_INCLUDE
        >
        > ------------------------ 8< --------------------------
        > Q: Do I #include <SDL.h> or <SDL/SDL.h>?
        > A: The most portable way to include SDL headers is
        > to use quotes around the header name:
        > #include "SDL.h"
        > ------------------------ 8< --------------------------

        I knew that. I nevertheless suggested using include <SDL/SDL.h>
        since I don't believe including "SDL.h" is more portable.

        >
        > And the "makefile magic" you're referring to is to
        > specify the right compiler option to GCC, viz.
        > "-I/usr/local/include/SDL" if your SDL header files
        > are in /usr/local/include/SDL.

        Means the same thing. If you use include "SDL.h" you need to
        specify the include directory on the command line. The same
        command line may not work for another user at all. He still has
        to know where he installed SDL. And so, use of #include
        "SDL.h" is no more portable than the use of #include <SDL/SDL.h>
        only difference is of course, he needs to modify the include
        statement in the latter case.

        --

        regards,
        Pallav.

        _______________________________________________________________________
        Anyway, I keep picturing all these little kids playing some game in this
        big field of rye and all. Thousands of little kids, and nobody's around --
        nobody big, I mean -- except me. And I'm standing on the edge of some crazy
        cliff. What I have to do, I have to catch everybody if they start to go
        over the cliff -- I mean if they're running and they don't look where they're
        going I have to come out from somewhere and catch them. That's all I'd do
        all day. I'd just be the catcher in the rye. I know it; I know it's crazy,
        but that's the only thing I'd really like to be. I know it's crazy.
        -- J.D. Salinger, "Catcher in the Rye"
        _________________________________________________________________
        | |
        |Pallav Nawani |
        |Sasken Communication Technologies Ltd. |
        |Domlur, Bangalore. |
        |Personal Web Page: http://members.dencity.com/pallavnawani |
        |_______________________________________________________________|
      • ranjit_mathew
        ... Please see the thread SDL headers starting with this message: http://www.libsdl.org/pipermail/sdl/1999-December/022730.html As you had pointed out
        Message 3 of 10 , Mar 1, 2002
          > I knew that. I nevertheless suggested using include <SDL/SDL.h>
          > since I don't believe including "SDL.h" is more portable.

          Please see the thread "SDL headers" starting with
          this message:

          http://www.libsdl.org/pipermail/sdl/1999-December/022730.html

          As you had pointed out earlier, using sdl-config almost
          always guarantees correct compiler and linker flags
          and should be preferred over hardcoding (or asking
          the user to modify) the include path.

          Ditto with other "well-behaved" libraries like GTK,
          The GIMP, etc.

          Ranjit.
        Your message has been successfully submitted and would be delivered to recipients shortly.