Before, I was able to compile on my terminal via g++. I tried installing a new compiler such as mp-gcc47. Now when I try to compile, it gives me errors such as
fatal error: ctype: No such file or directory compilation terminated.
How do I revert to the compilers that came with OSX
I have Xcode also installed. I'm not sure if that has to do with anything.
Assuming g++ is a soft link to mp-gcc47. The default compiler from OSX is in /usr/bin. If you are getting something like /opt/local/bin/g++ you have two options: if using macports enter: sudo port select gcc none to deactivate mp-gcc47 (or the fink equivalent if you installed gcc 4.7 with fink). The second option is, if you are using macports, fink, or a custom install, make sure /usr/bin is listed in the PATH environment variable before whatever folder mp-gcc47 is in, e.g. PATH=/usr/bin:$PATH . That way the g++ in /usr/bin will be found before g++ in whatever folder mp-gcc47 (again g++ is soft link to this). If your issue is when compiling another program set the environment variable CXX=/usr/bin/g++