Jacek M
Jacek M

Reputation: 2418

"couldn't make stderr distinct from stdout" when running Cygwin commands

I am trying to setup some old version of Cygwin on my Windows 7 x64 OS. So far so good. Now I am stuck at srdout/stderr distinction problem:

$ vmake
  1 [main] make 7060 dtable::stdio_init: couldn't make stderr distinct from stdout

$ ls /
  1 [main] ls 8180 dtable::stdio_init: couldn't make stderr distinct from stdout
Cygwin.bat  Cygwin.ico  bin  cygdrive  etc  lib  proc  setup.log  setup.log.full  tmp  usr  var

I am running:

$ uname -srv
  1 [main] uname 5876 dtable::stdio_init: couldn't make stderr distinct from stdout
CYGWIN_NT-6.1-WOW64 1.5.25(0.156/4/2) 2008-06-12 19:34

The Cygwin installation had DOS line-endings option selected (for some legacy code compatibility).

To fix another issues with line endings (bash had troubles processing /cygdrive/c/cygwin-legacy/bin/vmake script, like issue described here: http://chess.eecs.berkeley.edu/softdevel/faq/5.html ) I've added these to ~/.bash_profile:

export SHELLOPTS
set -o igncr

After reading http://lists-archives.com/cygwin/50369-run-requires-cygwin-tty.html I also set:

$ CYGWIN=tty

This changed nothing. I am still getting

1 [main] make 7060 dtable::stdio_init: couldn't make stderr distinct from stdout

with different 4-digit number each time.

Upvotes: 14

Views: 11782

Answers (5)

AndrewD
AndrewD

Reputation: 5208

Check that the executable is a cygwin version

I got this error when trying to launch a Msys executable from within cygwin. Msys is another 'linux on windows' environment and is incompatible with cygwin.

Specifically, I was trying to launch Git for Windows via a symlink in my /bin path. I apparently had installed it ages ago and created the symlink then, and didn't notice any problems until I tried to use git gui which then threw the couldn't make stderr distinct from stdout error. Interestingly, many of the git commands to work, or fail silently so it wasn't immediately noticable.

When cygwin tries to launch a program intended for the Msys environment, it throws the error.

To fix it, download the cygwin version of the problem app, and remove any symlinks you have in place that are pointing to the Windows version.

For the Git case :

  • I deleted /bin/git symlink
  • re-ran cygwin setup and installed git (cygwin version)

Upvotes: 1

Nuno Furtado
Nuno Furtado

Reputation: 4568

A little note for people having this issue with other binaries like ssh. I had this error since cygwin was trying to run windows ssh client instead of the version in cygwin

Upvotes: 6

Paul Lynch
Paul Lynch

Reputation: 1337

Removing C:\DevKit\bin from my path made the problem go away for me.

Upvotes: 0

Stephan Lokum
Stephan Lokum

Reputation: 126

I have had the same problem here. Then I remembered, that we replaced the "make" command by an MSYS-Version (since the 'make' of the new cygwin package did not handle any pathes with colons (":") -> this lead to "multiple target" errors.

The replacement of the 'make' command solved this problem, but caused "stdio_init: couldn't make stderr distinct from stdout" when I was trying to compile other projects.

Therefore:

Do you have MSYS/MinGW installed on your machine, too ?

Try this:

make --version

it should look like:

GNU Make 3.82.90
Built for i686-pc-cygwin

if you get something like:

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-msys

You need to use the cygwin 'make' instead.

Perhaps this error occurs if you mix up the components of different cygwin versions...

Upvotes: 11

mvnukov
mvnukov

Reputation: 306

This helped me:

Try a Cygwin 1.7 beta test release instead:

http://cygwin.com/#beta-test

Cygwin 1.5.25 is not really supported on Windows 7. Only Cygwin 1.7 gets tested on it.

Upvotes: 0

Related Questions