Reply to comment

Using colorgcc in Ubuntu (and other Linux distributions)

colorgcc is an awesome little tool for colorizing the output of gcc and g++, making compiler errors and warnings much easier to spot.

It hasn't been updated since 1999, but it hardly seems to matter. It's written in perl and available on most (if not all) Linux distributions. In gentoo colorgcc is installed as a compiler front-end. This makes it trivially easy to use.

Ubuntu has an official package for the project, but no real official support for it (yet). It's really very easy to set it up:

First of all, /usr/local/bin should already be in your $PATH variable, by default. Not only is it in the $PATH, it's the second item in the path, meaning it is searched very early on when looking for an executable.

So, to automatically use colorgcc, all we have to do is add a symbolic link from /usr/local/bin to /usr/bin/colorgcc

cd /usr/local/bin
sudo ln -s /usr/bin/colorgcc gcc
sudo ln -s /usr/bin/colorgcc g++
sudo ln -s /usr/bin/colorgcc cc
sudo ln -s /usr/bin/colorgcc c++

And there, you should be up and running with nice colorful output.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post PHP code. You should include <?php ?> tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.