Compilerfehler bei überladener Funktion



  • Hallo,

    ich wollte gerne mal eine Kollisionsabfrage mit SDL_collide ausprobieren. Und habe dazu die Source Code und die Header Datei meinem Projekt zugefügt. Der Compiler spuckte mir zwar so um die 30 Fehler aus, von denen ich jetzt alle bis auf 2 behoben habe. Diese beziehen sich auf einen Quelltextabschnitt indem es um 2 überladene Funktionen geht:

    SDL_collide.hpp
    int SDL_CollideBoundingBox(SDL_Surface *sa , int ax , int ay , SDL_Surface *sb , int bx , int by);
    und
    int SDL_CollideBoundingBox(SDL_Rect a , SDL_Rect b);
    Fehlermeldung: "Pfad"\sdl_collide.hpp(81) : error C2733: second C linkage of overloaded function 'SDL_CollideBoundingBox' not allowed
    "Pfad"\sdl_collide.hpp(81) : see declaration of 'SDL_CollideBoundingBox'

    int SDL_CollideBoundingCircle(int x1 , int y1 , int r1 , int x2 , int y2 , int r2 , int offset);
    und
    int SDL_CollideBoundingCircle(SDL_Surface *a , int x1 , int y1 ,
    SDL_Surface *b , int x2 , int y2 ,
    int offset);
    Fehlermeldung: "Pfad"\sdl_collide.hpp(102) : error C2733: second C linkage of overloaded function 'SDL_CollideBoundingCircle' not allowed
    "Pfad"\sdl_collide.hpp(100) : see declaration of 'SDL_CollideBoundingCircle'

    Hat jemand eine Idee wie ich die Fehlermeldung beheben kann???



  • Die Datei als C++ und nicht als C-Source kompilieren 😉 (oder extern "C" entfernen)


Anmelden zum Antworten