If I take the prolog file main_write.pl:
main :-
open('test.txt', write, S, [encoding(utf8)]),
write(S, 'Hello world!'),
close(S).
and then compile it using a command:
swipl -q --toplevel=main --stand_alone=true -o c_main_write -c main_wite.pl
I get c_main_write file and when I run it, I get the following errors:
./c_main_write
ERROR: /usr/lib/swi-prolog/library/filesex.pl:57: Initialization goal raised exception:
ERROR: '$open_shared_object'/3: files: cannot open shared object file: No such file or directory
What is the proper (error-less) way to compile this code?
I am using the following machine and swipl:
Linux 3.2.0-61-generic #93-Ubuntu SMP i686 i686 i386 GNU/Linux
SWI-Prolog version 6.6.5 for i386
This error is not dependent on file writing predicates, this error happens even if a body of the clause is very simple like member(1,[1,2]).