[link error]undefined reference to 'print'

This one's a simple typo - you meant to type:
printf("Adding %c%c** to 4char.ppm..\n", i, j);

but instead did:
print("Adding %c%c** to 4char.ppm..\n", i, j);

I think it's great that you're trying to start learning about security and programming through a hands-on approach, but I would suggest taking a few steps back and learning the basics of C++ or even programming in general before you tackle this stuff.

Good luck!