missing type specifier - int assumed SDL clean_up();

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
RandomDever
Chaos Rift Regular
Chaos Rift Regular
Posts: 198
Joined: Thu Mar 26, 2009 8:42 pm
Current Project: My Engine
Programming Language of Choice: C++

missing type specifier - int assumed SDL clean_up();

Post by RandomDever »

Code: Select all

void clean_up()
{
    //Free the surfaces
    SDL_FreeSurface( background );

    //Free the sound effects
    Mix_FreeChunk( scratch );
    Mix_FreeChunk( high );
    Mix_FreeChunk( med );
    Mix_FreeChunk( low );

    //Free the sound effects
    Mix_FreeMusic( music );

    //Close the font
    TTF_CloseFont( font );

    //Quit SDL_mixer
    Mix_CloseAudio();

    //Quit SDL_ttf
    TTF_Quit();

    //Quit SDL
    SDL_Quit();
}
Every time I use this function it gives me a missing type specifier message.........
Then it gives me this:
'int clean_up(void)' : overloaded function differs only by return type from 'void clean_up(void)'
WTF!?!?!?!?!?!
VC++ Just created an error by itself. :| :| :| :| :| :| :| :| :|
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: missing type specifier - int assumed SDL clean_up();

Post by short »

Every time I use this function it gives me a missing type specifier message.........
Then it gives me this:
'int clean_up(void)' : overloaded function differs only by return type from 'void clean_up(void)'
WTF!?!?!?!?!?!
VC++ Just created an error by itself. :| :| :| :| :| :| :| :| :|
Is your prototype of you cleanup function set as a int return type on accident?
This:

Code: Select all

int clean_up();
instead of

Code: Select all

void clean_up();
??
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
Post Reply