for me (ios4.2), in order to not get an undefined symbol error when linking, the line
CGImageRef UIGetScreenImage();
needs to be
UIKIT_EXTERN CGImageRef UIGetScreenImage();
see http://discussions.apple.com/thread.jspa?threadID=2339583 for more details