0

I took these steps:

download windows binary Mercury 14.01 (Visual Studio 2013 32bit)
    (this is near the bottom of http://dl.mercurylang.org/index.html)
double click the downloaded file (it's a .exe file), it installed into 'C:\mercury-14.01-vs2013\
add 'C:\mercury-14.01-vs2013\bin' to Path
open a cmd.exe window
create file hello.m from Ralph Beckett's intro
add the hello.m file to 'C:\mercury-14.01-vs2013\bin' (illogical, Captain)
in the cmd.exe window type 'mmc --make hello'

but Windows brings up a dialog for Microsoft Management Console.

How do I invoke the Melbourne Mercury 14 Compiler on a .m file? Previous stackoverflow question is for Mercury 11.07.1 and refers to README files which aren't in Mercury 14.

Mercury fits into my hoped-for cross-platform toolchain:

exploratory Prolog -> Mercury -> .NET -> Xamarin.Forms in Visual Studio -> all app stores

platforms: Windows 10, Mercury 14, Visual Studio Community 2017

  • 1
    Windows doesn't mistake anything. It executes the first file it finds that matches that name when it is traversing the directories in the PATH.. Put the path to the compiler first in the PATH instead of last. Or you can simply rename the compiler to something else (like MercMC.exe) that doesn't conflict with an OS executable. In either case, you should then complain to the developer that decided to give their compiler the same name as a Windows system program in the first place - they're the one that made the mistake, not Windows. :-) – Ken White Sep 20 '18 at 01:53
  • a sanity check on what it all comes down to, so I have learnt that if something works it's due to luck. %-) – Illogical Captain Sep 20 '18 at 23:11

1 Answers1

0

It matters where in the path it is. Try

c:\>set path=C:\mercury-14.01-vs2013\bin;%path%

c:\>mmc
David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
  • Thanks David, this fixed it. I found the 'set path' command only takes effect when done from C:\> as in your answer, not from C:\Windows\System32> for example which is where I was. – Illogical Captain Sep 20 '18 at 23:12
  • @IllogicalCaptain: That's not correct. `set PATH` works from anywhere in a command prompt, not just a specific directory. Type `set /?` from a command prompt. – Ken White Sep 20 '18 at 23:15
  • The path change can be done from wherever, but the path is only searched _after_ the current directory. And mmc.exe is in c:\windows\system32. – David Browne - Microsoft Sep 20 '18 at 23:48
  • So it is and I never knew it was there. Plus I am looking for set and forget. Checking [link](https://stackoverflow.com/questions/19287379/how-do-i-add-to-the-windows-path-variable-using-setx-having-weird-problems) and [link](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx) – Illogical Captain Sep 21 '18 at 00:14