I want the code to: Recognize the modules it has been using for months. I accidentally moved my program files to a different directory (I intended to copy them there). I moved them back, and everything looked fine, until I tried to run them.
But what I’m getting is:
ERROR: c:/users/ed/documents/prolog/rnafold.pl:18:
ERROR: source_sink `setup’ does not exist
Warning: c:/users/ed/documents/prolog/rnafold.pl:18:
Warning: Goal (directive) failed: user:use_module(setup)
My code looks like this:
in the main program:
:- use_module(utilities).
:- use_module(setup).
:- use_module(library(thread)).
:- use_module(parallel).
and, in setup.pl:
:- module(setup, [rules/2, plb/3, base/1, base_e/1, bond_pair/3, nobond/3, init/3, pairs_mn_mx/5, scopes/1]).
A quick way to check if a file can be loaded is to try to load it manually using consult/1 or with the preferred syntactic sugar of [<file name>], e.g.
?- [my_code].
For more advanced use cases use file_search_path/2. This is used often in the SWI-Prolog source code. (search)
Thanks for the reply. Unfortunately, changing the working directory doesn’t seem to help.
% c:/Users/Ed/Documents/Eternadev/Setup .pl compiled into setup 0.00 sec, 0 clauses
| pwd.
% c:/users/ed/documents/eternadev/
true.
?-
ERROR: c:/users/ed/documents/eternadev/rnafold.pl:18:
ERROR: source_sink `setup' does not exist
Warning: c:/users/ed/documents/eternadev/rnafold.pl:18:
Warning: Goal (directive) failed: user:use_module(setup)
% c:/Users/Ed/Documents/Eternadev/Rnafold.pl compiled 0.00 sec, 0 clauses```
So, I compiled setup.pl: OK
checked with pwd: OK
compiled rnafold.pl: Error, setup does not exist!
Here are the beginnings of the two files in question: