c++ceclipsegccgnu-toolchain

Eclipse: GNU toolchain - C files compiled with g++, duplicate GNU C


I've added a GNU toolchain in (modified) Eclipse and I'm having the issue of *.c files being compiled with g++ instead of gcc.

I've tried:

  1. Tweaking the C/C++ General -> File Types project properties page. This establishes the connection file-extension -> file-type (e.g. *.c -> C Source File).

  2. Tweaking the C/C++ General -> Language Mappings project properties page. This one continues the chain from file-type -> language-type (e.g. C Source File -> GNU C).

  3. Resetting up the toolchain, a few times :)

So what I have now is *.c -> C Source File -> GNU C. I'm guessing somewhere (maybe toolchain settings which I couldn't find, configuration files?) there's also currently a GNU C -> g++.exe connection. I need to change that to GNU C -> gcc.exe:

I also see a duplicate entry of GNU C at C/C++ General -> Paths and Symbols -> Includes -> Languages.

enter image description here

I'm hoping someone has hit a similar issue and can give me some (highly appreciated) hints.

Update:

I've also noticed a tool-conflict issue when inspecting the toolchain tool-list:

enter image description here enter image description here


Solution

  • I have no idea what weird Eclipse bug causes this, but found a workaround.

    Use the MinGW GCC toolchain instead (ignore the benign warning in the image, yet another Eclipse CDT bug):

    and set MINGW_HOME, MSYS_HOME and PATH manually to the wanted values: