I’m currently getting a very wierd SIGSEGV (Segmentation fault), not using any pointers that is, just enums; this is my code:
typedef enum
{
LIGHT,
DARK,
NONE
} Color;
class Board
{
public:
Color toMove();
private:
Color side;
};
and the implementation is:
Color Board::toMove()
{
return side;
}
And I’m simply calling toMove(); with results in the segmentation fault; here’s gdb output:
Program received signal SIGSEGV, Segmentation fault.
0x004025ee in Board::toMove (this=0x0)
at ...\board.cpp:19
19 return side;
Anyone got an idea?
This lovely hint from your debugger (
this=0x0) suggests you tried to calltoMove()without a validBoardobject.