"Winapifamily.h: No existe tal archivo o directorio" al compilar SDL en Code :: Blocks
Estoy siguiendo junto con los tutoriales SDL2.0 de LazyFoo, usando Code :: Blocks 13.12. No he tenido problemas para vincular y ejecutar SDL2 en VS2010, pero he cambiado IDE y he encontrado este error:
winapifamily.h: No existe tal archivo o directorio
Creo que todo está vinculado correctamente. Apunté el programa a mis directorios SDL2 include y lib.
Buildlog: (se produce un error en el archivo: .. \ include \ SDL2 \ SDL_platform.h)
=== Build: Depuración en SDL2_Setup (compilador: GNU GCC Compiler) ===
error fatal: winapifamily.h: no existe tal archivo o directorio
=== La compilación falla: 1 error (s), 0 advertencia (s) (0 minuto (s), 0 segundo (s)) ===
Esta es la primera vez que hago una pregunta aquí. Busqué una respuesta en Google y busqué las preguntas / respuestas existentes aquí, pero no pude resolver el problema. Aquí está mi código también.
Mi código:
// Using SDL and standard IO
#include <SDL.h>
#include <stdio.h>
// Screen dimension constants
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
int main( int argc, char* args[] )
{
// The window we'll be rendering to
SDL_Window* window = NULL;
// The surface contained by the window
SDL_Surface* screenSurface = NULL;
// Initialize SDL
if( SDL_Init( SDL_INIT_VIDEO) < 0 )
{
printf( "SDL could not initialize! SDL_GetError: %s\n", SDL_GetError() );
}
else
{
// Create window
window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
if( window == NULL )
{
printf( "Window could not be created! SDL_GetError: %s\n", SDL_GetError() );
}
else
{
// Get window surface
screenSurface = SDL_GetWindowSurface( window );
// Fill the surface white
SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF));
// Update the surface
SDL_UpdateWindowSurface( window );
// Wait two seconds
SDL_Delay( 2000 );
}
}
// Destroy window
SDL_DestroyWindow( window );
// Quit SDL subsystems
SDL_Quit();
return 0;
}