this happens with both g++ and gcc as whenever I tried
gcc file_name and the above happens.
Your $GCC_COLORS is probably set up for a light background instead of a dark one.
-fno-diagnostics-colors in your Makefile or whatever build system you use. Bear in mind that build script might be setting that variable.
You could also try running without reverse video and see if it works.
The GCC manual has documentation on the GCC_COLORS environment variable.
Your terminal color scheme conflicts with GCC's default colors. That is, black on black is not visible. This is explained in the manual:
The colors are defined by the environment variable
GCC_COLORS. Its value is a colon-separated list of capabilities and Select Graphic Rendition (SGR) substrings. SGR commands are interpreted by the terminal or terminal emulator. (See the section in the documentation of your text terminal for permitted values and their meanings as character attributes.) These substring values are integers in decimal representation and can be concatenated with semicolons. Common values to concatenate include
39for default foreground color,
37for foreground colors,
97for 16-color mode foreground colors,
38;5;255for 88-color and 256-color modes foreground colors,
49for default background color,
47for background colors,
107for 16-color mode background colors, and
48;5;255for 88-color and 256-color modes background colors.
The default GCC_COLORS is
01;31is bold red,
01;35is bold magenta,
01;36is bold cyan,
01;32is bold green and
01is bold. Setting
GCC_COLORSto the empty string disables colors. Supported capabilities are as follows.
You will be able to modify the environment variable
GCC_COLORS to change
quote to a different color, something like
01;34. The wikipedia page on ANSI escape codes has more information.