CCRenderTexture uses OpenGL framebuffer object: it renders part of scene to selected buffer instead of screen buffer, and user can read FBO pixels or take it texture later. So you should not call
setSprite, you should render own sprite after FBO was binded.
CCSprite *temporarySprite = CCSprite::createWithTexture(tex);
CCRenderTexture *rt = CCRenderTexture::create(texSize.width, texSize.height);
// visit() draws sprite to framebuffer (not to screen)
// Use relative path instead of absolute.