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

11,502

Solution 1

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...

Solution 2

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

Solution 3

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)
Share:
11,502

Related videos on Youtube

jaccus
Author by

jaccus

I am an efficiency enthusiast of software development, simplification, automation, clean code, good practices and constant improvement. Quality-driven, skilled developer and solution architect with passion for cloud services and event-driven architectures.

Updated on September 16, 2022

Comments

  • jaccus
    jaccus over 1 year

    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.

  • jaccus
    jaccus over 11 years
    It's quite probable it was the cygwin versions mix up in my case. When moved all cygwin stuff I've had on my drive to another directory and installed the legacy cygwin version from scratch again it worked.
  • Rop
    Rop almost 10 years
    Thanx! Exactly the problem I had :)
  • Robbo_UK
    Robbo_UK over 9 years
    how to you use the cygwin 'make' instead. ?
  • Barney
    Barney almost 9 years
    Me too. Did either of you find a solution?
  • ysap
    ysap over 8 years
    @Robbo_UK - (I realize this is an old question, but for reference) you can change the PATH variable so that the Cygwin directory appears before any other directory with make.
  • DavidS
    DavidS over 6 years
    Same. I had this error because it was trying to use the ssh installed with Vagrant. I jtook Vagrant off the Windows PATH, used the Cygwin install tool to install openssh (not installed by default), and it worked.