User forums > Using Code::Blocks

sdl compiling

<< < (2/3) > >>

unclereg:
....................full command line compile logging is selected

BlueHazzard:
This is really messed up ???

1) Please use code tags to post code/ logs (use the button with the  # symbol in the topic editor)
2) Do you really make a Build->Rebuild (or ctrl-F11) ?
3) Is this really the output of the "Build Log" tab and NOT from the "Build Messages" ?
4) Have you created a project?
5) Have you really followed the steps from the link you posted, or have you tried something more?

greetings

unclereg:
ok ... i found a previous mail similar .. it seems i hadnt 'add' the test code properly ....
I have followed the tut meticulously ...
I have now managed a build which failed with coding probs ... rebuild gives..
-------------- Clean: Debug in sdlentry (compiler: GNU GCC Compiler)---------------

Cleaned "sdlentry - Debug"

-------------- Build: Debug in sdlentry (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -std=c++11 -g -std=c++11 -IC:\Users\Owner\Documents\sdlunzipped\SDL-1.2.15\include\SDL -c C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp -o obj\Debug\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.o
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp: In function 'int SDL_main(int, char**)':
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:15:2: error: 'SDL_Window' was not declared in this scope
  SDL_Window* window = NULL;
  ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:15:14: error: 'window' was not declared in this scope
  SDL_Window* window = NULL;
              ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:28:46: error: 'SDL_WINDOWPOS_UNDEFINED' was not declared in this scope
   window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
                                              ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:28:125: error: 'SDL_WINDOW_SHOWN' was not declared in this scope
   window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
                                                                                                                             ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:28:142: error: 'SDL_CreateWindow' was not declared in this scope
   window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
                                                                                                                                              ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:36:49: error: 'SDL_GetWindowSurface' was not declared in this scope
    screenSurface = SDL_GetWindowSurface( window );
                                                 ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:42:36: error: 'SDL_UpdateWindowSurface' was not declared in this scope
    SDL_UpdateWindowSurface( window );
                                    ^
C:\Users\Owner\Documents\uz01_hello_SDL-5\01_hello_SDL\01_hello_SDL.cpp:50:28: error: 'SDL_DestroyWindow' was not declared in this scope
  SDL_DestroyWindow( window );
                            ^
Process terminated with status 1 (0 minute(s), 0 second(s))
8 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

unclereg:
code in question


--- Code: ---/
*This source code copyrighted by Lazy Foo' Productions (2004-2015)
and may not be redistributed without written permission.*/

//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_Error: %s\n", SDL_GetError() );
}
else
{
//Create window
window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
if( window == NULL )
{
printf( "Window could not be created! SDL_Error: %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;
}

--- End code ---

BlueHazzard:
1) Please use code tags also for logs...
2) http://stackoverflow.com/questions/12695719/sdl-window-does-not-name-a-type or use google future, you have now a sdl problem, not a code blocks problem and so this is the wrong forum to ask this questions

greetings

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version