I think I solved it! It was actually trouble with the graphics.h When I copypasted all the graphics.h into my .cpp, the compiler gave an error that int right was declared twice in the following code:
void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right=0, int right=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
redefinition of int right, so as it is just a prototype, I change it to:
void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right=0, int=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
Now it works!!!