SDL



  • Super danke, genau sowas habe ich gesucht. Aber klappen tuts immer noch nicht so ganz, zumindestens sind es schon mal weniger Fehler als sonst.
    Ich hab eine Code::blocks SDL Application erstellt, und dann einfach mal deren Standard Code kompiliert (natürlich nachdem ich das Installations Tutorial gemacht habe) und es kamen folgende Fehler.

    Project : SDL Application
    Compiler : GNU GCC Compiler (called directly)
    Directory : H:\C++ Projekte\SDL\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: main.cpp
    In file included from H:/Programme/CodeBlocks/include/sys/types.h:21,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:32,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:32,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/sys/types.h:32: error: ISO C++ does not support long long' H:/Programme/CodeBlocks/include/sys/types.h:110: error: ISO C++ does not supportlong long'
    H:/Programme/CodeBlocks/include/sys/types.h:115: error: ISO C++ does not support long long' In file included from H:/Programme/CodeBlocks/include/stdio.h:26, from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:35, from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26, from H:/Programme/CodeBlocks/include/SDL/SDL.h:28, from main.cpp:6: H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension In file included from H:/Programme/CodeBlocks/include/stdio.h:28, from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:35, from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26, from H:/Programme/CodeBlocks/include/SDL/SDL.h:28, from main.cpp:6: H:/Programme/CodeBlocks/include/stdarg.h:6:2: warning: #include_next is a GCC extension In file included from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:35, from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26, from H:/Programme/CodeBlocks/include/SDL/SDL.h:28, from main.cpp:6: H:/Programme/CodeBlocks/include/stdio.h:330: error: ISO C++ does not supportlong long'
    In file included from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:35,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stdio.h:416:14: warning: use of C99 long long integer constant
    In file included from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:39,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:40,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stdarg.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/string.h:24,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:58,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/stdint.h:24,
    from H:/Programme/CodeBlocks/include/inttypes.h:7,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:64,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/inttypes.h:7,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:64,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stdint.h:33: error: ISO C++ does not support long long' H:/Programme/CodeBlocks/include/stdint.h:34: error: ISO C++ does not supportlong long'
    H:/Programme/CodeBlocks/include/stdint.h:43: error: ISO C++ does not support long long' H:/Programme/CodeBlocks/include/stdint.h:44: error: ISO C++ does not supportlong long'
    H:/Programme/CodeBlocks/include/stdint.h:56: error: ISO C++ does not support long long' H:/Programme/CodeBlocks/include/stdint.h:57: error: ISO C++ does not supportlong long'
    H:/Programme/CodeBlocks/include/stdint.h:64: error: ISO C++ does not support long long' H:/Programme/CodeBlocks/include/stdint.h:65: error: ISO C++ does not supportlong long'
    In file included from H:/Programme/CodeBlocks/include/inttypes.h:9,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:64,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    In file included from H:/Programme/CodeBlocks/include/ctype.h:20,
    from H:/Programme/CodeBlocks/include/SDL/SDL_stdinc.h:69,
    from H:/Programme/CodeBlocks/include/SDL/SDL_main.h:26,
    from H:/Programme/CodeBlocks/include/SDL/SDL.h:28,
    from main.cpp:6:
    H:/Programme/CodeBlocks/include/stddef.h:6:2: warning: #include_next is a GCC extension
    Process terminated with status 1 (0 minutes, 0 seconds)

    Igrendwas mit "long long", da hat er n dickes Problem mit.
    Kann mir bitte jemand helfen. Ich will jetzt endlich mal so eine behinderte Bibliothek zum Luafen bekommen, bei Allegro hab ich schon aufgegeben, deshlab versuch ichs jetzt mit SDL.
    Ich hoffe jemand von euch kennt sich damit aus, denn von Bibliotheken installieren hab ich gar kein Plan von, ich will doch einfach nur Programmieren....:(

    MfG
    Stromberg



  • BITTE! Kann mir keiner sagen was ich tun soll? Was die Fehlermeldungen heißen? Bzw. wie ich meinen Fehler finden kann?
    Ich werd hier noch verrückt vor lauter Konsolenprogrammierung.....ich brauch viele bunte Farben --> eben SDL!!!

    MfG
    Stromberg



  • kein problem, dass bekommst du schon hin, hatte am anfang auch probleme

    hast du die anleitung schritt für schritt gemacht?

    poste mal deinen code



  • Das is der standard Codeblocks Quellcode der bei jeder neuen SDL Apllication in der main steht. Und genau den hab ich halt zum testen compiliert und es sind die oben angegebenen Fehler aufgetreten.

    #ifdef __cplusplus
        #include <cstdlib>
    #else
        #include <stdlib.h>
    #endif
    #include <SDL/SDL.h>
    
    int main ( int argc, char** argv )
    {
        // initialize SDL video
        if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
        {
            printf( "Unable to init SDL: %s\n", SDL_GetError() );
            return 1;
        }
    
        // make sure SDL cleans up before exit
        atexit(SDL_Quit);
    
        // create a new window
        SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16,
                                               SDL_HWSURFACE|SDL_DOUBLEBUF);
        if ( !screen )
        {
            printf("Unable to set 640x480 video: %s\n", SDL_GetError());
            return 1;
        }
    
        // load an image
        SDL_Surface* bmp = SDL_LoadBMP("cb.bmp");
        if (!bmp)
        {
            printf("Unable to load bitmap: %s\n", SDL_GetError());
            return 1;
        }
    
        // center the bitmap on screen
        SDL_Rect dstrect;
        dstrect.x = (screen->w - bmp->w) / 2;
        dstrect.y = (screen->h - bmp->h) / 2;
    
        // program main loop
        bool done = false;
        while (!done)
        {
            // message processing loop
            SDL_Event event;
            while (SDL_PollEvent(&event))
            {
                // check for messages
                switch (event.type)
                {
                    // exit if the window is closed
                case SDL_QUIT:
                    done = true;
                    break;
    
                    // check for keypresses
                case SDL_KEYDOWN:
                    {
                        // exit if ESCAPE is pressed
                        if (event.key.keysym.sym == SDLK_ESCAPE)
                            done = true;
                        break;
                    }
                } // end switch
            } // end of message processing
    
            // DRAWING STARTS HERE
    
            // clear screen
            SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
    
            // draw bitmap
            SDL_BlitSurface(bmp, 0, screen, &dstrect);
    
            // DRAWING ENDS HERE
    
            // finally, update the screen :)
            SDL_Flip(screen);
        } // end main loop
    
        // free loaded bitmap
        SDL_FreeSurface(bmp);
    
        // all is well ;)
        printf("Exited cleanly\n");
        return 0;
    }
    

    MfG
    Stromberg



  • hast du denn genau das sdl-paket runter geladen, welches in der anleitung angegeben ist?

    probiere mal:
    öffne das projekt, dann gehe auf Projekt > Build options > Linker

    dann trag bei other linker options folgendes ein
    -lmingw32 -lSDLmain -lSDL

    und versuche dann mal das projekt zu compilieren



  • Bringt nichts, ist genauso wie zuvor.
    http://www.bilder-space.de/show.php?file=zRVWL9Tbd9ZHS9T.JPG

    MfG
    Stromberg



  • -lmingw32
    -lSDLmain
    -lSDL

    du hast die Striche vergessen

    und links braucht das nicht



  • Mit den Strichen "-" gehts leider auch nicht. 😞

    MfG
    Stromberg



  • welche codeblocks version hast du denn?
    sonst lade nochmal die neuste codeblocksverion mit mingw von codeblocks.org
    und mache die anleitung + den sdl download komplett nochmal



  • Ich hab V. 1.0rc2
    Ist diese Version zu alt?



  • Hab mir gerade die neuste Codeblocks Version runtergeladen, jetzt klappts...
    Vielen Dank für deinen Rat!

    MfG
    Stromberg


Anmelden zum Antworten