2012年9月13日 星期四

Write an C++ program on Mac

Perpare
1.GCC
2.eclipse for c or C++

For dealing with the first problem, I am strongly recommend you to read this blog.
http://www.memoryz.info/install-gcc-on-mac.html
It provides everything you need for installing GCC on Mac OS.
The author provides two ways for tackling such trouble.

The first solution will be more geek-like and you need to use some commands for achieving the goal.

First of all, you need to download GCC from the website showed below.
http://hpc.sourceforge.net/

Choosing one suitable version for yourself and then unzip the file by following command: gunzip gcc-lion.tar.gz then install it by command line: sudo tar -xvf gcc-lion.tar -C /

Lastly, you need to save the configure. Insert vi ~/.bash_profile and add the following content export PATH=/usr/local/bin:$PATH

The second approach will be so convenient and what you need to do is just download the install file from OSX GCC Installer and then install it like most apps on mac!

The second problem will be so easy to figure out so I just leave it to you guys, haha

Hoping that you enjoy it!