Reputation: 3444
Using ncurses in C++, how would I colour my text in a console/terminal without breaking MinGW support? Are there any other libraries that can do this? I know that you can do it with ASCII characters, but this isn't fully supported. I don't want to use the Windows API.
Upvotes: 3
Views: 1199
Reputation: 28882
I can't speak for NCurses, but I have used PDCurses to do color under winXP/MSVC 6, WIN7/MSVC 2010 in a console application.
Upvotes: 0
Reputation: 11925
The discussion in the other answer is regarding Windows, so for the benefit of Win readers, I'm leaving this answer even though it is not cross-platform.
The Old New Thing blog covers some of the Win32 API that can be used to change text color in the console. See FillConsoleOutputAttribute and Console Screen Buffers.
Upvotes: 2
Reputation: 308530
Your reference to mingw implies that you expect this to work in a Windows Cmd window. Unfortunately the Cmd window doesn't support color, except globally for the whole window.
Upvotes: 1