In input.h
I define eventFunctions like so:
multimap <Uint8, function<void(SDL_Event&)>> eventFunctions;
Input.h is surrounded by:
#ifndef INPUT_H
#define INPUT_H
//code
#endif
However, on compilation I get this: multiple definition of eventFunctions
Referring to every file that includes input.h
.
I also added this to input.h to see how many times it gets processed during compilation: #warning "entered input_h"
The warning prints several times (every time it is included), showing that it is being processed more than once despite the include guards.
What am I doing wrong?