LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   colorful g++ (https://www.linuxquestions.org/questions/linux-distributions-5/colorful-g-327999/)

pttcoco 05-28-2005 01:01 PM

colorful g++
 
In some pc, when I compile with g++ in a Konsole, the output messages are coloured : error in red, warning in bleu, etc ...
But at home when I compile the same file, it does'nt have any color. Does anyone know the option to change to have coloured message ?
At home I used FC3, gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) with Konsole 1.4.1

pttcoco 05-30-2005 12:55 PM

With this code :

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
const char *const green = "\033[0;40;32m";
const char *const normal = "\033[0m";
int i;
fprintf(stderr,"%shello %sWorld\n",green,normal)
}

When I compile, I get this :
http://mhtrinh.free.fr/snapshot.jpeg

pttcoco 05-30-2005 02:20 PM

Thanks to all who read and try to respond to this thread.
I found the solution in an another forum.
I juste have to install the package colorgcc found at : http://www.mindspring.com/~jamoyers/software/colorgcc/


All times are GMT -5. The time now is 02:08 AM.