views:

225

answers:

2

On Windows XP I've installed Eclipse CDT. I've installed cygwin including make, gcc, g++, and gdb. I've added C:\cygwin\bin to the windows path variable.

When I create the default HelloWorld project in Eclipse and try to build, I get the following text in the console:

make all

make: echo: Command not found

make: * [src/test3.o] Error 127

If I try make at the command line, then all's well.

Other clues:

  • Note that I added C:\cygwin\bin to the path rather than C:\cygwin\usr\bin because I didn't find my GNU toolchain in \usr\bin but in \bin. This seems to contradict some online documentation. Stranger still, when I type which make in the command window (not cygwin bash), it reads /usr/bin/make !
  • I might have installed a new version of cygwin over an old version. I noticed some warnings about this, but since nothing seemed to be wrong with cygwin once complete (and further, since make from the cygwin bash works ok), I didn't dig deeper here.

(Note: there is a related question that I didn't find helpful. Perhaps it's answer was over my head.)

+1  A: 

The problem is that there is no echo binary in your PATH. Locate echo, and add it to your PATH environment variable.

Borealid
That's what I thought too, but: `which echo --> /usr/bin/echo`. Also `echo $0 --> bash`. Do I misunderstand something?
John Berryman
@John Berryman: Your Cygwin PATH is not the same as your Windows PATH. You need to go look at the "environment variables" section in the Control Panel -> System -> Advanced tab.
Borealid
@Borealid: I'm looking but I'm not seeing. I see the Path variable, but nothing else that looks like a place where I can store the cygwin path. Should I be adding a variable?
John Berryman
@John Berryman: I think you are probably confusing the Cygwin shell with the Windows `cmd.exe`. Your Eclipse-for-Windows does not use the Cygwin variables at all. In order to have access to Cygwin commands, you need to set the Path you see in the control panel to include `C:\cygwin\bin` or whatever.
Borealid
@Borealid: I'm pretty "green" with these type things, so it's definitely ok to assume ignorance. But I think we're on the same page with Windows and Cygwin paths being different. My current Windows Path variable is set to: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;...;C:\cygwin\bin
John Berryman
And when you run `cmd.exe` and type `C:\cygwin\bin\echo.exe foo`, you see `foo`?
Borealid
A: 

It works! I completely reinstalled cygwin and left the pathing the way I had it and Eclipse CDT compiles the hello world program. Something important in the last cygwin major update must have changed.

John Berryman