Outputting colored strings in Linux's Terminal

I am currently programming on Linux Mint using Eclipse, and since I hate the Eclipse console (because of its white background) I like to run my code using terminal. Now I know that if I were programming on windows that the line for outputting colored strings is:

1
2
system("Color 1A");
std::cout << "Hello World" << std::endl;



But this obviously does not work on Linux's terminal but only on Windows CMD, so is there a different command to output colored strings on Linux terminal or is feature only applicable to Windows?
Take a look at ncurses (google it).
Hey Chervil!

My eclipse isn't accepting the <curses.h> or <ncurses.h> library, I know you can download those manually but I'll leave that as a last resort since I would like to use this code on multiple computers without having to download the same library on each computer.

Are there any other libraries that would allow me to do this?
You can try looking into term.h for terminfo (included on most POSIX systems).
Hey NoXzema,

Eclipse did not have this library either but I do see it on the list of aptitude packages, is this something I need to download from there? And if so, exactly which package is the one I'm looking for?
Eclipse isn't going to have these libraries. That is up to you as the programmer to get these libraries. That's not the job of the IDE, and I'm not sure where you would have gotten that idea.

omurad wrote:
I would like to use this code on multiple computers without having to download the same library on each computer

You either bundle the library with your program, or you set a requirement for that library on your program. Generally, though, you want to just say the library is a dependency. Package managers handle this for users, so all they have to do is apt-get install your-program and the package manager will automatically download any dependencies they need.
Thanks you for the clear up ResidentBiscuit!
Topic archived. No new replies allowed.