Cygwin problem on windows path

1

I used cygwin to work in windows, however now I have a problem here.

Since I put my cygwin on D:\cygwin, when I try to run a program, namely ocamldep.exe, it returns a path error which I don't know how to fix.

The error is as follow.

/bin/sh: D:cygwinbinocamldep.exe: command not found

I know for sure they dont have cygwinbinocamldep.exe, but how to change this into ocamldep.exe only? Sorry but I'm really a dummy in Unix and everything on it.

zfm

Posted 2011-05-06T05:00:56.340

Reputation: 131

1this appliies to you or anybody with your problem Post, please, what's in your $PATH variable: echo $PATH will tell what's its value. But you can solve it without doing that.. – barlop – 2020-01-28T00:10:15.973

Answers

0

The basic solution to troubleshoot this is very simple.

Open a cmd prompt, try a simple path like SET PATH=. then ECHO $PATH% to see your path. Then run cygwin.exe so your cmd shell transforms into a cygwin one. (that's the old way of running cygwin and still works).

Then do echo $PATH have a look at it.. Then at least your path should be simple to see work with.

And the following works regardless of path. Try /cygdrive/c/blah/aaa.exe to run c:\blah\aaa.exe change the file path accordingly.

You shouldn't get any path variable issue with that because you aren't even using the path. And if there was some path issue like if somehow it got the PATH e.g. the value for $PATH, from elsewhere then you can find out where and adjust that.

barlop

Posted 2011-05-06T05:00:56.340

Reputation: 18 677

0

There's something wrong with your path. My guess is that string "D:\cygwin\bin\ocamldep.exe" is passed to sh, which then does backslash removal and ends up with D:\cygwinbinocamldep.exe.

Post, please, what's in your $PATH variable: echo $PATH will tell what's its value.

Apart of that you may try to run D:\cygwin\bin\ocamldep.exe, /cygwin/bin/ocamldep.exe or /bin/ocamldep.exe (first one is windows path with UNX style backslashes, second and third are native UNX paths, one of these might work).

Paweł Brodacki

Posted 2011-05-06T05:00:56.340

Reputation: 159

@powerl no you are misunderstanding what it says, it says "The PATH environment variable is used by Cygwin applications as a list of directories to search for executable files to run. This environment variable is converted from Windows format (e.g. C:\Windows\system32;C:\Windows) to UNIX format (e.g., /cygdrive/c/Windows/system32:/cygdrive/c/Windows) when a Cygwin process first starts" i.e. you don't convert it, it does and just in memory for $PATH. – barlop – 2020-01-28T00:08:30.783

C:\Program Files\PC Connectivity Solution\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\MiKTeX 2.8\miktex\bin;C:\Windows\System32;D:\Software\Office;D:\Software\Office\ps2pdf;D:\Software\Kuliah\XML Data Management\grep-2.5.4-bin\bin\;C:\Program Files\TortoiseSVN\bin; D:\Software\Kuliah\Semantic Web Technologies\apache-maven-2.2.1\bin;C:\Program Files\Windows Live\Shared; .;C:\Program Files\OpenVPN\bin; D:\Software\Programming\apache-maven-2.2.1\bin; C:\Program Files\Java\jdk1.6.0_20\bin;D:\cygwin\bin;D:\masm32\bin – None – 2011-05-06T07:33:07.850

This doesn't look good. According to http://www.cygwin.com/cygwin-ug-net/setup-env.html windows format PATH should be converted to UN*X format by the batch that starts your shell.

– None – 2011-05-06T07:40:22.160

@Pawel: I had that error too, but I have removed the "dos warning" on windows too and it worked for other command (like ocamlc.exe or ocamlopt.exe), but I will give it a try. – None – 2011-05-06T07:55:08.680

@Pawel: I have changed the path (at least for the cygwin) and then I got even a more trivial error You need Cygwin on Windows to build with Ocamlbuild. Please install in ... – None – 2011-05-06T08:08:19.973

I'm not sure what you mean by changing path for cygwin. What I mean is that your $PATH should show UN*X-like paths with directory names separated by "/", not "". You have to solve this problem to have programs running. Maybe this FAQ http://www.cs.nyu.edu/~yap/prog/cygwin/FAQs.html will help you.

– None – 2011-05-06T08:22:00.457