Linux makefiles help

Hello.

I am newcomer in Unix. I try to use SDL under Debian Linux.
Library have been compiled without any problem.
But config. file for examples does not work.
Could you give me some simple makefile for examples
compilation?

Best wishes.
Alexei Nikitin.

Alexey M. Nikitin wrote:

Hello.

I am newcomer in Unix. I try to use SDL under Debian Linux.
Library have been compiled without any problem.
But config. file for examples does not work.
Could you give me some simple makefile for examples
compilation?

Best wishes.
Alexei Nikitin.

You can download some examples of SDL program on the SDL page, so you
will get some Makefile too !

Sylvain
lawouach at caramail.com

Here’s a (not “the” :wink: makefile which compiles two of the test-programs
when called as “make all”:

--------
CC = gcc
CFLAGS = -O2 -Wall $(shell sdl-config --cflags)
LIBS = $(shell sdl-config --libs) -lm

testalpha: testalpha.c
${CC} ${CFLAGS} -o testalpha testalpha.c ${LIBS}
testsprite: testsprite.c
${CC} ${CFLAGS} -o testsprite testsprite.c ${LIBS}

all: testalpha testsprite
----—

Other programs can be added the same way.

All the best,
robOn Wed, Mar 22, 2000 at 03:13:34PM +0000, Alexey M. Nikitin wrote:

Hello.

I am newcomer in Unix. I try to use SDL under Debian Linux.
Library have been compiled without any problem.
But config. file for examples does not work.
Could you give me some simple makefile for examples
compilation?

Here’s an alternative version:

CFLAGS := -O2 -Wall $(shell sdl-config --cflags)
LIBS := $(shell sdl-config --libs) -lm

all: testalpha testsprite

testalpha: testalpha.o
$(CC) -o $@ $^ $(LIBS)

testsprite: testsprite.o
$(CC) -o $@ $^ $(LIBS)

This version is specific to the GNU Makefiles

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hi everyone,

I have been able to use an MP3 for the background track of the
aliens demo by simply changing the Mix_OpenAudio line to read

 Mix_OpenAudio( 22050, AUDIO_S16, 2, 4096 );

and symlinking my mp3 file as music.it. Simple as that.

The problem comes after the background music mp3 has stopped playing.
When that happens, the audio goes completely dead–shot.wav and
explode.wav then cease playing as well, even though they are fine
initially (while the MP3 is still playing). But, the video part of
the game continues with no apparent problems…until the ESC key
is pressed, whereupon the game sprites stop moving, but the game
window and xterm from which it was launched hang permanently.

Anyone else encountered this end-of-MP3 problem?

I also tried a plain .WAV file as the background music, and notice
that it loops perfectly. So, what I hope to do is be able to use
a background MP3 in place of a background WAV, without any strange
problems.

My platform is an x86 box running Redhat 6.0, and
I’m using the latest versions of the relevant packages:
SDL-1.1.1
SDL_mixer-1.0.5
smpeg-0.3.4

Thanks for any pointers,

Steve Madsen
H2Eye Ltd.
24-28 Hatton Wall
London EC1N 8JH
UNITED KINGDOM (UK)
Tel: +44 (0) 207 404 9600
Fax: +44 (0) 207 404 9490
Email: @Steve_Madsen

Hi everyone,

I have been able to use an MP3 for the background track of the
aliens demo by simply changing the Mix_OpenAudio line to read

 Mix_OpenAudio( 22050, AUDIO_S16, 2, 4096 );

and symlinking my mp3 file as music.it. Simple as that.

The problem comes after the background music mp3 has stopped playing.
When that happens, the audio goes completely dead

Again, this is a bug in smpeg. You can get the latest CVS code which
has this fixed from http://cvs.lokigames.com/.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec