Uninformative error when using gecode from Windows cmd
I've encountered a problem while trying to use gecode from Windows cmd, like in the Basic Usage example here: https://docs.minizinc.dev/en/stable/command_line.html
Only output is =====ERROR=====.
Running the same model from MiniZinc IDE with gecode works. Also running the command with other solvers works.
I've tried reinstalling the whole MiniZinc bundle but this hasn't fixed the problem.
I wonder if this is the same issue that's causing https://github.com/MiniZinc/minizinc-python/issues/174
Could you try running that command with -v for verbose output and see if it outputs anything else?
Sorry that I haven't mentioned that I had already tried running this with --verbose. It stops in the same place as in the linked issue, only difference is that there is also:
=====ERROR=====
I get an error when I try just open fzn-gecode.exe from File Explorer too.
Could you try running minizinc -c --solver gecode model.mzn data.dzn which should create model.fzn and then fzn-gecode model.fzn and see what error it gives you?
And if you're using powershell, could you run echo $LastExitCode afterwards and see the exit code it ends up with?
Thanks
Actually, after doing some thinking - I suspect what's happening is that we package a version of Gecode which requires the Qt DLLs to be available.
Running from the IDE happens to allow them to be found since they're in the same folder as the IDE application, but then when running from the command line, the OS can't find them.
As a workaround, could you try adding the MiniZinc install directory to your PATH? E.g. in PowerShell, you can temporarily change your PATH with
$env:Path = $env:ProgramFiles + '\MiniZinc;' + $env:Path
Or if you installed just for your user:
$env:Path = $env:LocalAppData + '\Programs\MiniZinc;' + $env:Path
Thanks, adding the MiniZinc directory to PATH solved the issue.