"Winapifamily.h: Keine solche Datei oder kein solches Verzeichnis" beim Kompilieren von SDL in Code :: Blocks
Ich verfolge die SDL2.0-Tutorials von LazyFoo mit Code :: Blocks 13.12. Ich hatte keine Probleme damit, SDL2 zu verbinden und in VS2010 auszuführen, habe aber die IDE geändert und bin auf folgenden Fehler gestoßen:
winapifamily.h: Keine solche Datei oder Verzeichnis
Ich denke alles ist richtig verlinkt. Ich habe das Programm auf meine SDL2-Verzeichnisse include und lib verwiesen.
Buildlog: (Fehler tritt in Datei auf: .. \ include \ SDL2 \ SDL_platform.h)
=== Build: Debug in SDL2_Setup (Compiler: GNU GCC Compiler) ===
Schwerwiegender Fehler: winapifamily.h: Keine solche Datei oder Verzeichnis
=== Build schlägt fehl: 1 Fehler, 0 Warnung (en) (0 Minute (n), 0 Sekunde (n)) ===
Dies ist das erste Mal, dass ich hier eine Frage stelle. Ich habe bei Google nach einer Antwort gesucht und die vorhandenen Fragen / Antworten hier durchsucht, konnte das Problem jedoch nicht lösen. Hier ist auch mein Code.
Mein Code:
// 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;
}