FWIW,
to supplement the existing answer, "Look at your compiler's messages,"
and to address the first of the two questions, essentially, "What version/installation of GCC is Eclipse presently using?",
borrowing heavily from [https://www.jblopen.com/gcc-toolchain-eclipse-setup-guide-part-2/][JBLopen], and to render future access to that link less significant, a helpful place to start for finding the default path(s) to the toolchain(s) used by Eclipse is this:
"Window" (menu item) -> Preferences -> (under General is) C/C++ (expand to see) -> Core Build Toolchains.
This system presently shows five entries:
- /usr/bin/gcc
- /usr/bin/c99-gcc
- /usr/bin/c89-gcc
- /usr/bin/x86_64-linux-gnu-gcc
- /usr/bin/clang
Also, under Properties (menu item) (or File -> Properties, when the Project Name is selected in that "view"), -> C/C++ Build (expand to see) -> Tool Chain Editor. This doesn't give paths, but it provides clues as to which tools are being used. (If, in studying those, one clicks "No ToolChain" and can't get the drop-down list back, just click "Cancel," and that drop-down list will be available, again.)
Also, another clue, not directly a path, but a clue, in this Linux set-up, comes from Properties -> Linux Tools Path. which, for these current settings, indicates "Use the System Environment PATH".
Just to touch on the second question, there are processes for installing other compilers and toolchains. That part is findable via web search. Once another compiler, etc., is installed, back under Window -> Preferences -> C/C++ -> Core Build Toolchains, Eclipse provides a way to add User Defined Toolchains.
Linux 18.04
Eclipse (C/C++) 2019-03