0

I'm currently trying to set up a dev environment and I can't get a simple "hello world" application to build properly. I have Eclipse and MinGW with GCC installed and have added

C:\MinGW\bin
C:\MinGW\msys\1.0\bin

to my path and am using

C:\MinGW\msys\1.0\bin\make.exe

as the build command. Whenever I try to build, I get the following error:

Description         Resource    Path    Location    Type
make: *** [TCP.exe] Error 127   TCP                 C/C++ Problem
trojanfoe
  • 120,358
  • 21
  • 212
  • 242
Dyne
  • 9
  • 1
  • 4
  • Take a look at this question. Maybe it can help. http://stackoverflow.com/questions/12165746/how-to-install-c-plugin-to-eclipse/12169583#12169583 –  Mar 27 '13 at 16:03
  • 1
    if you just use `make.exe` (or `mingw32-make.exe` or whatever your executable is called) on the command line does it work? At least that can isolate an eclipse setup issue from a install/path issue – Mike Mar 27 '13 at 16:07

1 Answers1

0

With Eclipse, MinGW integrates seamlessly. Make sure you have the following added to your environmental path:

YourPath\MinGW\include; YourPath\MinGW\bin;

When choosing to make a new C++ project, I personally prefer an Empty Project under Project type: and ensure that the MinGW GCC is listed under Toolchains:. Choose both of those, give the project a name, and select Finish. IF MinGW is not under Toolchains: then it is not set properly in your environment or you need to restart your machine.

Right-Click the project name to add a new Source-Folder (I typically call 'src') and then Right-Click on the new source folder to add a Source File and subsequently write your hello world code. So long as CDT is set to Internal Builder and you have made no changes otherwise to the Eclipse project settings, your program should build properly and you should observe in the console:

12:27:48 **** Rebuild of configuration Debug for project Demo ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\main.o" "..\\src\\main.cpp" 
g++ -o Demo.exe "src\\main.o" 

12:27:50 Build Finished (took 1s.262ms)

If you want to enable c++11 within Eclipse/MinGW, just refer to the answer contained in Eclipse CDT C++11/C++0x support

Community
  • 1
  • 1
Mushy
  • 2,535
  • 10
  • 33
  • 54