Harry's Graffiti

Always Be Coding, Never Be Evil

Colorgcc: Color Your Compilation Output

If you’re heavy coder, I believe you will like colorgcc, this tiny script saves your time on digging comlilation errors and warnings.

Like my example below.

harrypan@harrypan-E6440:~/workspace$ gcc -g -Wall CountInversion.c
CountInversion.c: In function ‘Merge’:
CountInversion.c:23:1: error: expected ‘;’ before ‘}’ token
CountInversion.c:23:1: warning: control reaches end of non-void function [-Wreturn-type]
harrypan@harrypan-E6440:~/workspace$

On ubuntu, you can easily get the colorgcc by sudo apt-get install colorgcc, follow by review and build symbolic links.

  1. Review $PATH variable, make sure /usr/local/bin is prior than /usb/bin, which is my installed gcc path
harrypan@harrypan-E6440:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
  1. Make some symbolic links under /usr/local/bin to fulfill your need
cd /usr/local/bin
sudo ln -s /usr/bin/colorgcc gcc
sudo ln -s /usr/bin/colorgcc g++

Okay, now enjoy your rest of coding.