For
ERROR: catch/3: Unknown procedure: module/2
ERROR: However, there are definitions for:
ERROR: module/1
check that module/2 is the first Prolog statement in the Prolog source code file.
When creating temporary Prolog source code files there may be lines at the top, e.g.
:- working_directory(_,'C:/Users/Groot/Documents').
Later when the code needs to be made a proper module, module/2 is added e.g.
:- working_directory(_,'C:/Users/Groot/Documents').
:- module(do_something,[]).
but that will generate the error.
module/2 needs to be first, e.g
:- module(do_something,[]).
:- working_directory(_,'C:/Users/Groot/Documents').
I can’t count how many times I see the error and spend a few minutes checking the module/2 statement for errors when it is not the syntax for module/2 that is wrong, just moving the statement is all that is needed.