"Undefined reference" normally means the linker can't find the function definition. Is this you real code? You shouldn't be getting this error because bake() is obviously being defined. Instead you should have got an error because you used -> and not . when calling the function.
Is not my real code. I didn't see the "->", i changed it to "." but the output is same.
If i test this code in windows the program work :/
(in linux tested with gnuc++11 and c++11)