Jump to content

  • Log In with Google      Sign In   
  • Create Account

SDL_types.h file not found using xcode


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 wilprim   Members   -  Reputation: 108

Like
0Likes
Like

Posted 11 February 2013 - 10:32 PM

Getting this error when trying to use SDL_mixer...

SDL_types.h file not found..

I am including all the correct files as far as I can tell and have included the frameworks (both SDL and SDL_mixer) to my /systems/library/frameworks folder and it compiles well until I add SDL_mixer.h to my project. What should I do?

Here is main.cpp

 

#include <SDL/SDL.h>
#include "SDLMain.h"
#include "SDL_mixer.h"


int main(int argc, char ** argv)
{
SDL_Init(SDL_INIT_EVERYTHING);
Mix_Chunk song;
//Initialize SDL_mixer
if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 4096 ) == -1 )
{
return false;
}

song = Mix_LoadWAV("song.wav");
SDL_SetVideoMode(1000, 500, 32, SDL_SWSURFACE);
SDL_Event event;
bool done = false;
while(!done)
{
while (SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
{
done = true;
}
if (event.type == SDL_KEYDOWN)
{
if (event.key.keysym.sym == SDLK_UP)
{
Mix_PlayChannel( -1, song, 0 );
}
}
}
}
SDL_Quit();

return 0;
}
 

 

Thanks



Sponsor:

#2 rip-off   Moderators   -  Reputation: 8727

Like
0Likes
Like

Posted 12 February 2013 - 04:00 AM

The SDL documentation states that the most portable way to include SDL is via:

#include "SDL.h"

This is probably what SDL_Mixer is doing. You should configure your compiler so that you don't have to specify SDL/SDL.h.



#3 wilprim   Members   -  Reputation: 108

Like
0Likes
Like

Posted 12 February 2013 - 03:55 PM

Thanks for reply... How would I go about configuring xcode to not have to specify SDL/SDL.h  ?



#4 rip-off   Moderators   -  Reputation: 8727

Like
0Likes
Like

Posted 13 February 2013 - 09:14 AM

I don't use xcode but I would start googling some like this.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS