0

I have search around and cannot find the answer to my question. I have installed MinGW GCC compiler only (No G++). I have sent the path and can compile "hello world" from the command line. Next, in eclipse, I have created a new "C" project with a "C" source file. I have also set my include folder.

I have the same "Hello World" code, but when I go to compile, I get "G++ not in path". This is expected as because I don't have G++ installed. However, I do not seem to be able to tell eclipse that I want to use the installed GCC compiler.

If I go to Properties->C/C++ Build->Settings->GCC C Compiler the command reads "gcc". So I don't understand what I doing wrong.

Any pointer will be very gratefully received.

Kind Regards, Harold Clements

4
  • Try to compile on the terminal (maybe thru a builder like make). Then get an editor (or configure your Eclipse to make it use the same compilation command that you are typing). Don't forget to pass -Wall -Wextra -g to gcc (or to g++ or clang) Commented Dec 24, 2014 at 17:49
  • I am completely confused. My question is really how to I configure Eclipse to the use the GCC compiler and not the g++. Commented Dec 24, 2014 at 17:57
  • @haroldjclements Sorry, haven't used it in a while. Just wondering, do you have much invested in using Eclipse? you might try SublimeText3 (you might need to also download some add-on packages) or Qt Creator (which includes make tools). They run faster. Commented Dec 24, 2014 at 18:16
  • To be honourest, no I don't. I have been using Notepad++ and just wanted something a little more useful when it comes to code completion and debugging. Commented Dec 24, 2014 at 18:30

1 Answer 1

2

Check which type of the project you created in Eclipse and toolchain selected for the project.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for your response.I have selected a C project, created a C source file and selected MinGW GCC. If I go to Properties->C/C++ Build->Settings->GCC C Compiler the command reads "gcc".Is there anything that I have missed?
Properties->C/C++ Builder->Tool Chain Editor->"Select Tools..." try removing all C++ related things and play with different builder. I don't have MinGW installed, but selected this toolchain - it builds using some fallback to GCC.
There is also a chance that your source file has ".C" (capital C extension) that may be treated as C++ file - see this Properties->C/C++ general->Filetypes
Thank you all. After removing all the C++ build related items and throwing in a reboot, all is good in the world. Happy Holidays....Harold Clements

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.