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.
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...
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
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)
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.
Removing C:\DevKit\bin from my path made the problem go away for me.
Related
I'm using cygwin installed on Windows 10 and trying to access awscli from it.
I used pip install awscli to install awscli. This installed awscli. I then tried to run only aws to see if it is installed and I get the following error:
-bash: /cygdrive/c/Program Files/Anaconda2/Scripts/aws: C:\Program: bad interpreter: No such file or directory
I'm not sure why this is happening. Any help in this regard would be highly apreciated.
This is still an issue even with the latest version of AWS cli. So after some trial and error I found a pretty good workaround that will not make you switch your favorite shell.
First, make sure python is on your PATH. That is from anywhere in the system you can just run python and it work.
Find the aws script and open it for editing (for me it was located in c:\Program Files\Python36\Scripts\aws) and change the hashbang (that would be the first line in the script) to #!python.exe. For me it was set to #!c:\Program Files\Python36\python.exe. That space in the middle of Program Files caused the issue when that path got converted to Linux like path. Changing it to #!python.exe sidesteps the issue.
When you update AWS cli, repeat the workaround.
PS. You could also avoid this issue by installing python somewhere in a folder without spaces in path. That requires to reconfigure your system, so I did not do that myself.
I would install the standard python and ensure it is coming up first in your path with which python and which pip. Path issues like this are due to mixing and matching executables targeting different platforms in my experience. Certain commands do not implement functionality to convert paths from Windows to Linux and back (it appears your specific commands are failing on spaces).
Since you say you are on Windows 10, if you have the anniversary edition, I would recommend Windows Subsystem for Linux over cygwin. You will likely see less Windows issues on WSL since it uses the exact same ubuntu packages you would use on Linux instead of the cygwin port and maps them low level to the NT Kernel.
The Problem comes from "Program Files" having a space. This is something that is related to cygwin (I encountered the same error with git bash on windows). In a script I had something like this:
#!/c/Program Files/some_program/executable.exe
Escaping the space with a backslash or using quotes didn't work.
The solution is to use the DOS' short filename:
Progra~1 for "Program Files"
Progra~2 for "Program Files (x86)"
So my line would turn into:
#!/c/Progra~1/some_program/executable.exe
In Windows:
cd .. to go to home directory which shows pwd as /.
Now, cd to /cygdrive/c/Program\ Files/Anaconda2/Scripts
Now, run: python aws configure
Example:
user#user /cygdrive/c/Program Files/Anaconda2/Scripts
$python aws configure
I am following this :
Step 2: Installing Cygwin
Cygwin can be downloaded from http://www.cygwin.com
Run the setup file.
Install from internet. Specify C:\cygwin as the root directory.
In the Select Packages dialog box, select the packages required. gcc-core, gcc-g++, gdb, and make packages are most important. These are the C core, C++ core, the GNU Debugger and the GNU version of ‘make’ utility. These packages will be under the ‘Devel’ category.
Complete the installation.
Step 3: Testing Cygwin
To test whether Cygwin was installed properly, try the following by opening the bash shell:
cygcheck -c cygwin
gcc --version
g++ --version
make --version
gdb --version
If the version details are displayed for all these commands, the installation of Cygwin has been successful.
I got this from here
But the result I get is:
What is wrong or missing with my installation.
Follow up question:
I wanted to use the terminal window in netbeans that is why I installed this.
In this terminal widnow I also have problem. I cant type anything on it. Is this the reason for it?
Try to run /usr/bin/g++. If it is not found, then you don't have g++ installed (installation may have had problems).
You can follow the same procedure for the rest of your commands
If /usr/bin/g++ runs successfully, it means you don't have /usr/bin in your PATH (which is very unlikely). You can put that in your PATH in your startup file.
I am trying to install GNU m4 package on Bash on Ubuntu on Windows 10, but always fail at configuration stage.
I wrote these:
wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
tar xvzf m4-1.4.17.tar.gz
cd m4-1.4.17
./configure --prefix=/usr/local/m4
However, the configuration process stopped at this stage:
checking whether rename honors trailing slash on source...
I had waited for more than 8 hours with no progress. I tried to restart my PC and repeated similar steps, but the trouble remains.
I found a similar question here, but I want to explain a bit more details about my own trouble.
I would appreciate any suggestion. Thanks.
This is caused by a bug in Bash on Windows. As a workaround, try building m4 from a Linux directory instead of a Windows one (i.e., build it in /home/$USER/ instead of a subdirectory of /mnt/c).
I'll love something like Microsoft Visual Studio's line-by-line debugging in bash, with current variables values and so.
Is there any tool or way to do it? set -x and set -v are nice but not perfect.
See bashdb.
If it's installed on your system, see man bashdb.
If it's not installed, see http://bashdb.sourceforge.net
Yes. Use "bashdb" from http://bashdb.sourceforge.net/
Latest version at time of writing
http://sourceforge.net/projects/bashdb/files/bashdb/4.2-0.8/
If you are on a Mac (like I was) then you might need to install the GNU version of Bash.
I did that using "MacPorts"
http://www.macports.org/
Once you have MacPorts...
port install bash
Then follow the instructions to
./configure (in bashdb unpacked directory)
make
sudo make install
Then add the folder where bashdb can be found in your PATH
I'm on a Windows XP box. I'm using putty 0.60 to access a unix account on a server running SunOS 5.10. In my .profile file I have the command "bash" to put me into that shell upon logging in.
I know with Linux there are options to display files and directories in different colors when I issue the command "ls".
Can the same thing be set up for bash running in SunOS 5.10 ?
Thanks much in advance for any information.
Steve
as i understand it, the solaris version of ls (which you get by default in SunOS 5.10) does not support colored output. you'd have to install the gnu version of ls, which is included in the coreutils package.
rather than explain the process of installing the package, i'll direct you to this link instead:
http://tille.garrels.be/training/solaris/colorls.php
if you can't install packages on that server, you may be out of luck. hth