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.

4
  • 1
    this 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
    Jan 28, 2020 at 0:10
  • @zfm : In additon to what barlop said, note that the path separator under Cygwin is / and not \ . I have the impression that you run you code with backslashes as path separators. Jun 30, 2021 at 10:19
  • @zfm : While your PATH may or may not be wrong, from the error message I conclude that the error is not in the PATH, but in the way you invoke the program. Unfortunately you didn't provide this information.... Jul 6, 2021 at 11:52
  • @zim : Aside from checking your PATH (of course), did you try to run it by providing an explicit path? Oct 26, 2021 at 12:17

2 Answers 2

2

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.

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

6
  • 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
    – zfm
    May 6, 2011 at 7:33
  • This doesn't look good. According to 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.
    – Paweł Brodacki
    May 6, 2011 at 7:40
  • @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.
    – zfm
    May 6, 2011 at 7:55
  • @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 ...
    – zfm
    May 6, 2011 at 8:08
  • 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 cs.nyu.edu/~yap/prog/cygwin/FAQs.html will help you.
    – Paweł Brodacki
    May 6, 2011 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .