Once Xcode is installed, you may also need to install the command line tools in order to have them all in the system path. You can find the option in the preferences dialog of Xcode, in the Downloads section of it.
BTW, you better setup Code::Blocks to make use of Clang (3.2 as of Xcode 4.6) after installing the command line tools, which is more up to date than the GNU GCC that comes with it.