The problem is you're including function implementations in your header files.
In draw.h, you have implementations for
1 2 3 4
|
void init()
int getMax(bool axis)
void drawColumn(int pos,char krk)
void drawLine(int pos,char krk)
|
header files are for declarations, not implementations.
As soon as you include draw.h in more than one .cpp module, those functions get compiled multiple times, which is what the linker is trying to tell you.
This has nothing to do with include guards. When snake,cpp is compiled (which includes draw.h), those functions get compiled. Now when main.cpp gets compiled, those function get compiled again. main.cpp does not know those function definitions have been included elsewhere.
Move those function implementations to a .cpp file. They do not belong in a .h file.
Similar problems exist in point.h. snake.h is okay as it does not include any function implementations.