Running Windows Vista
Using Cygwin
Now everytime something is printed on to the screen it's always in white colour. How can I get different colours ?
Thanks
Printable View
Running Windows Vista
Using Cygwin
Now everytime something is printed on to the screen it's always in white colour. How can I get different colours ?
Thanks
Using gcc under cygwin, you can use ANSI Escape sequences
Eg.
Code:#define ESC "\032"
printf( ESC "[2J" ); /* clears screen */
Actually, AFAIK, you can use ANSI escape sequences as long as ANSI.SYS is loaded into memory, Cygwin or no.
If you want to use a lot of coloured text and screen clearing and other fancy stuff, consider a library like ncurses. (I believe it comes with Cygwin -- it did with mine at least.)
No intention of hijacking this thread. However, since Cygwin has been mentioned, I have a quick question: Is Cygwin a way of not to have to use MinGW port of gcc in Windows?
That's correct. However, Cygwin is more restricting than MinGW, DLL-wise. Programs using MinGW's GCC (e.g. compiled with Dev-C++) don't require any special DLLs or anything that I know of, besides standard Windows ones. Programs compiled with Cygwin do: cygwin.dll and cygwin1.dll, I think.
On the other hand, Cygwin is much more complete. It has bash. I mean, look at all of the packages! http://cygwin.com/packages/
Yeah, I would phrase it more like: is MinGW a way not to use Cygwin? :DQuote:
However, Cygwin is more restricting than MinGW, DLL-wise. Programs using MinGW's GCC (e.g. compiled with Dev-C++) don't require any special DLLs or anything that I know of, besides standard Windows ones. Programs compiled with Cygwin do: cygwin.dll and cygwin1.dll, I think.
Of course, if you want to be able to run configure scripts and such with MinGW, you also need to use MSYS, and even then the support for GNU/Linux tools is far more minimal than Cygwin.
Here is one more tutorila Change color.
ssharish