If the program compiles and you're getting a link error, you're missing the library that contains the printf function.
To repeat what Crasycat said, we can't help you further until you let us know what version of CodeWarrior you're using and the MCU you're targeting. This is a good a place as any to remind our forum users to please, please, please,
include the CodeWarrior version and target MCU in the subject line of your posting! It helps experts on a specific MCU notice your posting and get in touch with you.
---Tom