#include "SDL.h"

In the FAQ there is the question whether to use #include <SDL.h> or
#include <SDL/SDL.h>. Then the response is to use neither, but use
#include “SDL.h”.

I have RH 6.2, and I installed SDL 1.1.6 from the RPM. But when I try to
use the portable #include, the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.

I am also using kdevelop, and followed the direction from “SDL & K”.

Bryan

P.S. This was probably already in the list at one time, but it was real cool
to see Sam Lantinga on ZDtv a few weeks ago! Unfortunately I only caught the
last minute… :frowning:

This might be not the best way, but you only need to copy all the files in
the /usr/include/SDL/ directory to the /usr/include/ directory and everything
will work fine :slight_smile:

Sascha G?nther
(@Sascha_Gunther)On Friday 27 October 2000 17:12, you wrote:

In the FAQ there is the question whether to use #include <SDL.h> or
#include <SDL/SDL.h>. Then the response is to use neither, but use
#include “SDL.h”.

I have RH 6.2, and I installed SDL 1.1.6 from the RPM. But when I try to
use the portable #include, the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.


LINUX - Power for nothing and bits for free…

I have RH 6.2, and I installed SDL 1.1.6 from the RPM. But when I try to
use the portable #include, the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.

This might be not the best way, but you only need to copy all the files in
the /usr/include/SDL/ directory to the /usr/include/ directory and everything
will work fine :slight_smile:

Dear God, no.

-Isdl-config --cflags

BTW, the reason Sam doesn’t advocate <SDL/SDL.h> is because header
includes of that style don’t work on MacOS.

m.On Fri, Oct 27, 2000 at 05:13:30PM +0200, Sascha G?nther wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

-Isdl-config --cflags

Doh. Just sdl-config --cflags. No -I. :slight_smile:

m.On Fri, Oct 27, 2000 at 08:44:55AM -0700, Michael Vance wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

Michael Vance wrote:

I have RH 6.2, and I installed SDL 1.1.6 from the RPM. But when I try to
use the portable #include, the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.

This might be not the best way, but you only need to copy all the files in
the /usr/include/SDL/ directory to the /usr/include/ directory and everything
will work fine :slight_smile:

Dear God, no.

-Isdl-config --cflags

One annoying thing I run into on every RH 6.2 fresh install is that
Redhat doesn’t
include /usr/local/bin in the default path, which is where sdl-config
gets put by
default. This may be why it’s not getting found. One of the many
solutions is to
edit /etc/profile so /usr/local/bin is in the path…

Erik> On Fri, Oct 27, 2000 at 05:13:30PM +0200, Sascha G?nther wrote:

Dear God, no.

-Isdl-config --cflags

drop the -I, it should be included in the cflags already

BTW, the reason Sam doesn’t advocate <SDL/SDL.h> is because header
includes of that style don’t work on MacOS.

If I remember correctly there is an option to translate / to : in CodeWarrior.
Otherwise you could always do the mac equivalent of

for f in SDL*.h; do ln -s $f SDL/$f; done

with MacOS aliases instead of symlinks, since / is a legal file name char

One annoying thing I run into on every RH 6.2 fresh install is that
Redhat doesn’t
include /usr/local/bin in the default path, which is where sdl-config
gets put by
default.

This is actually a good thing since it makes people write cleaner
Makefiles with less linux-centric assumptions. Many people don’t install
SDL in /usr or /usr/local for various reasons (not being root is one)

Mattias Engdeg?rd wrote:

One annoying thing I run into on every RH 6.2 fresh install is that
Redhat doesn’t
include /usr/local/bin in the default path, which is where sdl-config
gets put by
default.

This is actually a good thing since it makes people write cleaner
Makefiles with less linux-centric assumptions. Many people don’t install
SDL in /usr or /usr/local for various reasons (not being root is one)

I don’t agree. It might be nice if RedHat doing this encouraged less
system-specific install scripts, but since most open source and free
software programs install things into /usr/local by default, all this
Redhat-ism does is annoy people that don’t use RPMs.

Sam, what was your rationale behind installing by default into
/usr/local?

Erik

-Isdl-config --cflags

Doh. Just sdl-config --cflags. No -I. :slight_smile:

m.

Ok… I tried ‘sdl-config --cflags’. The command works fine, the message I
receive is ‘-I/usr/include/SDL -D_REENTRANT’. But when I try to make, it
still can’t find SDL.h.

Bryan> On Fri, Oct 27, 2000 at 08:44:55AM -0700, Michael Vance wrote:

Ok… I tried ‘sdl-config --cflags’. The command works fine, the message I
receive is ‘-I/usr/include/SDL -D_REENTRANT’. But when I try to make, it
still can’t find SDL.h.

No, back-ticks, in the Makefile, as your .c -> .o build rule.

Ie:

sdl-config --cflags

not:

‘sdl-config --cflags’

m.On Fri, Oct 27, 2000 at 02:15:08PM -0400, Bryan Pope wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

Sascha G?nther wrote:

Bryan Pope wrote:

In the FAQ there is the question whether to use
#include <SDL.h> or #include <SDL/SDL.h>. Then
the response is to use neither, but use #include
"SDL.h".

I have RH 6.2, and I installed SDL 1.1.6 from the
RPM. But when I try to use the portable #include,
the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.

This might be not the best way, but you only need to
copy all the files in the /usr/include/SDL/ directory
to the /usr/include/ directory and everything will
work fine :slight_smile:

Either that or add “-I/usr/include/SDL” (or whatever) to the compiler
options. I use automake/autoconf which takes care of all those little
details. :slight_smile:

  • Randi

Regimental Command
Generic Armored Combat System
http://regcom.sourceforge.net

Sascha G?nther wrote:

Bryan Pope wrote:

In the FAQ there is the question whether to use
#include <SDL.h> or #include <SDL/SDL.h>. Then
the response is to use neither, but use #include
"SDL.h".

I have RH 6.2, and I installed SDL 1.1.6 from the
RPM. But when I try to use the portable #include,
the compilier cannot find it. When I use
<SDL/SDL.h> everything is a-ok.

This might be not the best way, but you only need to
copy all the files in the /usr/include/SDL/ directory
to the /usr/include/ directory and everything will
work fine :slight_smile:

Either that or add “-I/usr/include/SDL” (or whatever) to the compiler
options. I use automake/autoconf which takes care of all those little
details. :slight_smile:

That was what I needed! Thanks. (I am using kdevelop)

Bryan

I am seeing all these people suggest using:

sdl-config --cflags

although this has NEVER worked for me, the shell doesn’t read the ` symbol
right, so what I use is

$(sdl-config --cflags)

and in a makefile just add another dollar sign:

$$(sdl-config --cflags)

I use RedHat 6.1, maybe this can help other redhat users…

sdl-config --cflags

although this has NEVER worked for me, the shell doesn’t read the ` symbol
right, so what I use is

$(sdl-config --cflags)

and in a makefile just add another dollar sign:

$$(sdl-config --cflags)

No. Either write

CFLAGS=$(SDLCONFIG) --cflags

— note the backquotes, ASCII 0x60 — or

CFLAGS=$(shell $(SDLCONFIG) --cflags)

The $(shell …) construct instructs make to pass the command to a shell
and collect the output for substitution, while the backquote syntax is
not handled by make at all — it is passed along with the other arguments
to the shell as part of the compiler invocation, and the substitution is
done by the shell there. Either should work.

The $$(sdl-config …) syntax is particular bad, since the doubled $
causes make to pass $(sdl-config …) to the shell, and this only
works if the shell is bash — not a standard bourne shell.

Define SDLCONFIG as the name of your SDL configuration command, to allow
for SDL to be installed in any directory (or for people, especially
developers, to keep multiple SDL installations and choose which one to
use). I.e.

SDLCONFIG=sdl-config

or

SDLCONFIG=/fie/foe/foo/sdl-4.711/bin/sdl-config

Of course, if you care about performance and are using GNU make, use
:= instead of = and $(shell …) instead of backquotes.

Hi,i got some trouble with mouse under linux frame buffer mode.
I am using SDL-1.1.6 and want to run test program.(testwin)

It tell me:
Couldn’t initialize SDL: Unable to open mouse

But my PS/2 mouse is works fine with gpm -t ps/2

Any comment?

					Chester

Hi,i got some trouble with mouse under linux frame buffer mode.
I am using SDL-1.1.6 and want to run test program.(testwin)

It tell me:
Couldn’t initialize SDL: Unable to open mouse

But my PS/2 mouse is works fine with gpm -t ps/2

Any comment?

Check the permissions for:
/dev/psaux

You should have read/write access…

:wink:

Alex

Chester

----- Original Message -----
From: chester@linux.org.tw (Chester)
To:
Sent: Monday, October 30, 2000 10:29 AM
Subject: [SDL] mouse under fb

Hi,i got some trouble with mouse under linux frame buffer mode.
I am using SDL-1.1.6 and want to run test program.(testwin)

It tell me:
Couldn’t initialize SDL: Unable to open mouse

But my PS/2 mouse is works fine with gpm -t ps/2

Any comment?

Check the permissions for:
/dev/psaux

You should have read/write access…

:wink:

Alex

Hi,
I change this mode to 777 or 755 ,but still can’t test program.
Do i need to turn of gpm daemon??

				ChesterOn Mon, 30 Oct 2000, Alexander Pipelka wrote:

----- Original Message -----
From: <@Chester>
To:
Sent: Monday, October 30, 2000 10:29 AM
Subject: [SDL] mouse under fb

Sam, what was your rationale behind installing by default into
/usr/local?

By long-standing UNIX tradition, software that is installed as
a part of the system is installed in /usr, while software that
is installed by third-party providers is installed in /opt, or
an even more venerable location, /usr/local

You’ll note that the RPM and debian packages install into /usr.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Hi,i got some trouble with mouse under linux frame buffer mode.
I am using SDL-1.1.6 and want to run test program.(testwin)

It tell me:
Couldn’t initialize SDL: Unable to open mouse

But my PS/2 mouse is works fine with gpm -t ps/2

Hi,
I change this mode to 777 or 755 ,but still can’t test program.
Do i need to turn of gpm daemon??

Do you have the problem when you run as root?
Do you have /dev/mouse as a symbolic link to the real mouse device?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Thanks,it wrok again.

			ChesterOn Tue, 7 Nov 2000, Sam Lantinga wrote:

Hi,i got some trouble with mouse under linux frame buffer mode.
I am using SDL-1.1.6 and want to run test program.(testwin)

It tell me:
Couldn’t initialize SDL: Unable to open mouse

But my PS/2 mouse is works fine with gpm -t ps/2

Hi,
I change this mode to 777 or 755 ,but still can’t test program.
Do i need to turn of gpm daemon??

Do you have the problem when you run as root?
Do you have /dev/mouse as a symbolic link to the real mouse device?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software