Fehlermeldungen bei SDL
-
Moin!
Ich habe folgenden Code bei mir versucht zu übersetzen:
// Example program: // Using SDL2 to create an application window #include <SDL.h> #include <stdio.h> int main(int argc, char* argv[]) { SDL_Window *window; // Declare a pointer SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2 // Create an application window with the following settings: window = SDL_CreateWindow( "An SDL2 window", // window title SDL_WINDOWPOS_UNDEFINED, // initial x position SDL_WINDOWPOS_UNDEFINED, // initial y position 640, // width, in pixels 480, // height, in pixels SDL_WINDOW_OPENGL // flags - see below ); // Check that the window was successfully created if (window == NULL) { // In the case that the window could not be made... printf("Could not create window: %s\n", SDL_GetError()); return 1; } // The window is open: could enter program loop here (see SDL_PollEvent()) SDL_Delay(3000); // Pause execution for 3000 milliseconds, for example // Close and destroy the window SDL_DestroyWindow(window); // Clean up SDL_Quit(); return 0; }
Dann kamen folgene Fehlermeldungen:
C:\Users\no\Desktop\test.cpp In function 'int SDL_main(int, char**)': 9 5 C:\Users\no\Desktop\test.cpp [Error] 'SDL_Window' was not declared in this scope 9 17 C:\Users\no\Desktop\test.cpp [Error] 'window' was not declared in this scope 16 9 C:\Users\no\Desktop\test.cpp [Error] 'SDL_WINDOWPOS_UNDEFINED' was not declared in this scope 20 9 C:\Users\no\Desktop\test.cpp [Error] 'SDL_WINDOW_OPENGL' was not declared in this scope 21 5 C:\Users\no\Desktop\test.cpp [Error] 'SDL_CreateWindow' was not declared in this scope 35 29 C:\Users\no\Desktop\test.cpp [Error] 'SDL_DestroyWindow' was not declared in this scope C:\Users\no\Desktop\test.cpp At global scope: 7 14 C:\Users\no\Desktop\test.cpp [Warning] unused parameter 'argc' [-Wunused-parameter] 7 31 C:\Users\no\Desktop\test.cpp [Warning] unused parameter 'argv' [-Wunused-parameter]
Wurde beim Kopieren der Daten von SDl irgendwas falsch gemacht? (http://wiki.codeblocks.org/index.php/Using_SDL_with_Code::Blocks)
Oder woran liegt es?
Danke