terça-feira, 30 de agosto de 2011

How to play a .wav file with SDL

This example is based on an example provided here.


Here is the callback function:


domingo, 28 de agosto de 2011

Problem with error: conflicting types for ‘SDL_main’

Are you getting this error?
error: conflicting types for ‘SDL_main’ /Library/Frameworks/SDL.framework/Headers/SDL_main.h:57: error: previous declaration of ‘SDL_main’ was here

I was going to do some audio tests with SDL in Mac OS X but I wasn't able to run a simple example because I was having the problem above. I solved it just by commenting the line 54 of SDL_main.h in /Library/Frameworks/SDL.framework/Versions/A/Headers.

54 //#define main SDL_main


Probably this is not the best way to solve this problem, but it worked for me.

Kind regards!