尝试在xcode 4.6上使用SDL_mixer时出现此错误...
在SDL_mixer.h文件中找不到SDL_types.h文件
据我所知,我包含了所有正确的文件,并将框架(包括SDL和SDL_mixer)包含到我的/ systems / library / frameworks文件夹中,并且编译得很好,直到我将SDL_mixer.h添加到我的项目中。我该怎么办?
这是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;
}