<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I split my now working code into two modules, and I am as sure as I can be that I did everything correctly but obv. not!<div class="">The mmcdoc project has been my benchmark so far and as far as I can see apart from the names, I have the same makefile, and followed the pattern, but I am getting a link error:</div><div class=""><div class=""><br class=""></div><div class="">➜ f2 make</div><div class="">mmc -s hlc.gc -O4 -E --make felt</div><div class="">Making Mercury/int3s/options.int3</div><div class="">Making Mercury/ints/options.int</div><div class="">Making Mercury/cs/felt.c</div><div class="">felt.m:037: In clause for predicate `main'/2:</div><div class="">felt.m:037: error: undefined predicate `do_command_line'/4.</div><div class="">** Error making `Mercury/cs/felt.c'.</div><div class="">make: *** [felt] Error 1</div></div><div class=""><br class=""></div><div class="">Here are the relevant parts of the files:</div><div class=""><br class=""></div><div class=""><b class="">felt.m</b></div><div class=""><div style="color: rgb(48, 48, 48); background-color: rgb(255, 255, 255); font-size: 12px; line-height: 18px; white-space: pre;" class=""><div class="">:-<span style="color: #0066cc;" class=""> module</span> felt.</div><div class="">:-<span style="color: #0066cc;" class=""> interface</span>.</div><div class="">:-<span style="color: #0066cc;" class=""> import_module</span> io.</div><div class="">:-<span style="color: #0066cc;" class=""> pred</span> main(io::di, io::uo) <span style="color: #0066cc;" class="">is</span> <span style="color: #0066cc;" class="">det</span>.</div><div class="">:-<span style="color: #0066cc;" class=""> implementation</span>.</div><div class="">:-<span style="color: #0066cc;" class=""> import_module</span> list, maybe, string.</div><div class="">:-<span style="color: #0066cc;" class=""> use_module</span> options.</div></div></div><div class=""><div style="color: rgb(48, 48, 48); background-color: rgb(255, 255, 255); font-size: 12px; line-height: 18px; white-space: pre;" class=""><div class="">main(!<span style="color: #000000;" class="">IO</span>) :-</div><div class=""> do_command_line(<span style="color: #000000;" class="">Flags</span>, <span style="color: #000000;" class="">Files</span>, !<span style="color: #000000;" class="">IO</span>),</div><div class=""> (</div><div class=""> <span style="color: #000000;" class="">Flags</span> = <span style="color: #0066cc;" class="">no</span></div><div class=""> ;</div><div class=""> <span style="color: #000000;" class="">Flags</span> = <span style="color: #0066cc;" class="">yes</span>(<span style="color: #009900;" class="">_Options</span>),</div><div class=""> foldl(io.print_line, <span style="color: #000000;" class="">Files</span>, !<span style="color: #000000;" class="">IO</span>)</div><div class=""> ).</div><br class=""></div></div><div class=""><br class=""></div><div class=""><b class="">options.m</b></div><div class=""><div style="color: rgb(48, 48, 48); background-color: rgb(255, 255, 255); font-size: 12px; line-height: 18px; white-space: pre;" class=""><div class="">:-<span style="color: #0066cc;" class=""> module</span> options.</div><div class="">:-<span style="color: #0066cc;" class=""> interface</span>.</div><div class="">:-<span style="color: #0066cc;" class=""> import_module</span> io.</div><div class="">:-<span style="color: #0066cc;" class=""> import_module</span> bool, char, getopt_io, list, map, maybe, string.</div><div class="">:-<span style="color: #0066cc;" class=""> pred</span> do_command_line(</div><div class=""> maybe(option_table(felt_option))::out,</div><div class=""> list(string)::out,</div><div class=""> io::di, io::uo) <span style="color: #0066cc;" class="">is</span> <span style="color: #0066cc;" class="">det</span>.</div>% some exported types then...<br class=""><div style="line-height: 18px;" class=""><div class="">:-<span style="color: #0066cc;" class=""> implementation</span>.</div><div class="">:-<span style="color: #0066cc;" class=""> import_module</span> list, string.</div><div style="line-height: 18px;" class=""><div class=""><br class=""></div><div class="">do_command_line(<span style="color: #000000;" class="">Options</span>, <span style="color: #000000;" class="">SourceFiles</span>, !<span style="color: #000000;" class="">IO</span>) :-</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">And I guess here’s the makefile just to be sure…. sorry…. :|</div><div class="">Help!!! </div><div class=""><br class=""></div><div class=""><div style="line-height: 18px;" class=""><div class=""><span style="color: #000000;" class="">BIN</span>=felt</div><div class=""><span style="color: #000000;" class="">DEPS</span>=felt.m options.m</div><div class=""><span style="color: #000000;" class="">FILES</span>=<span style="color: #cc6600;" class="">$(</span><span style="color: #883399;" class="">patsubst</span><span style="color: #cc6600;" class=""> %.m,%,$(</span><span style="color: #000000;" class="">DEPS</span><span style="color: #cc6600;" class="">))</span></div><div class=""><span style="color: #000000;" class="">GENEXT</span>=d,o,mh,err,c,c_date,mh,mih</div><div class=""><span style="color: #000000;" class="">GRADE</span>=hlc.gc</div><div class=""><span style="color: #aaaaaa;" class=""># this one links to the extras folder in case you need it.</span></div><div class=""><span style="color: #aaaaaa;" class=""># FLAGS=--ml posix --mld /usr/local/mercury-rotd-2021-04-15/extras/lib/mercury -s $(GRADE) -O4</span></div><div class=""><span style="color: #000000;" class="">FLAGS</span>=-s <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">GRADE</span><span style="color: #cc6600;" class="">)</span> -O4 -E</div><br class=""><div class=""><span style="color: #883399;" class="">all</span>:: <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span></div><br class=""><div class=""><span style="color: #883399;" class="">install</span>:: <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span></div><div class=""> mv -f -v <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span> <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">HOME</span><span style="color: #cc6600;" class="">)</span>/bin/</div><br class=""><div class=""><span style="color: #883399;" class="">%</span>: %.m <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">DEPS</span><span style="color: #cc6600;" class="">)</span></div><div class=""> mmc <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">FLAGS</span><span style="color: #cc6600;" class="">)</span> --make <span style="color: #0066cc;" class="">$@</span></div><br class=""><div class=""><span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span>: <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">DEPS</span><span style="color: #cc6600;" class="">)</span></div><div class=""> mmc <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">FLAGS</span><span style="color: #cc6600;" class="">)</span> --make <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span></div><div class=""> mv -fv <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span> <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span></div><br class=""><div class=""><span style="color: #883399;" class="">clean</span>::</div><div class=""> rm -rf Mercury</div><div class=""> rm -fv <span style="color: #0066cc;" class="">$$</span>(for x in <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">FILES</span><span style="color: #cc6600;" class="">)</span>; do echo <span style="color: #0066cc;" class="">$$</span>x.{<span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">GENEXT</span><span style="color: #cc6600;" class="">)</span>}; done)</div><div class=""> rm -fv <span style="color: #cc6600;" class="">$(</span><span style="color: #000000;" class="">BIN</span><span style="color: #cc6600;" class="">)</span></div><br class=""></div></div><div class=""></div></div></div></div></div></body></html>