eclipseeclipse-cdtcompiler-version

Eclipse C++'s compiler version


I'm using the Eclipse IDE for C++ (Eclipse CDT). I want to install the SFML library but I can't find what version of GCC my Eclipse uses.

Note: I have multiple GCC compilers (versions) installed on my computer.

Or how can I set up a different compiler for Eclipse to use?


Solution

  • You can check the -v (verbose) flag on in the project options, then compile any file. It'll cause gcc to print a lot of additional information as output, including version e.g.: gcc version 7.2.0. It also includes library search paths which should help you deduce where your compiler is located.

    This flag is located under project properties -> C/C++ Build -> Settings -> Tool Settings (tab) -> Selected compiler -> Miscellaneous -> Verbose (-v).

    As for which compiler is selected - it is generally taken from your PATH. System path is read by Eclipse upon startup. You can then go ahead and modify it by hand either on workspace level (Window -> Preferences -> C/C++ -> Build -> Environment) or on project level, for example if you wanted to use different compiler versions for different projects. The approach I use is to make sure that path to my toolchain is not added to system PATH and I add it by hand on the workspace level.