i am having issues with adding functions to a program that has a couple of my own header files and uses a couple of source files,
it works ok and compiles, but now when i am adding new functions i keep getting hassle from the compiler, its basically telling me functions are not declared in scope or elements that i am passing to function are not declared,
in the example below i cant understand why the following is not working >>
here is one of the header files, declared in main() as #include "graphic.h"
Code:
#ifndef GRAPHIC_H_INCLUDED
#define GRAPHIC_H_INCLUDED
SDL_Surface *screen;
SDL_Surface *temp;
SDL_Surface *PegArea;
SDL_Surface *Buttonarea;
SDL_Surface *Gameboard;
void DrawGameEvent(GamePieces solpeg[MAXDWN][MAXACR], bool peg_chosen); //this is existing stuff that works fine
// > function is implemented in project source file GraphicSource.cpp
void RefreshBoard(GamePieces solpeg[MAXDWN][MAXACR], MenuButton* pMenu); //this is existing stuff that works fine
// > function is implemented in project source file GraphicSource.cpp
void DrawBoard(); //this is my example that is not working created just for this test, function is called in main()
//and implemented in project source file GraphicSource.cpp
#endif // GRAPHICS_H_INCLUDED
#endif // GRAPHIC_H_INCLUDED
the call in main() is like this >
Code:
InitBoard(solpeg);
Drawboard(); //the offending function
Menu.InitButtons();
the function itself in the source file i just wrote as
Code:
void DrawBoard()
{
}
is there anything wrong with this? do i need to put some kind of arguments into the linker or something or am i missing something simple?