I want to make this prolog file a stand-alone EXE file

本秂侑毒 提交于 2019-12-05 12:52:27

As your code looks nicely portable on a quick reading, you can use GNU Prolog to generate an .exe file from it. Assuming the code is saved in a file named foo.pl, you can use GNU Prolog gplc command-line utility to generate your executable file:

$ gplc --no-top-level -o foo.exe foo.pl

But first you will need to add the following directives to your code at the top of the file:

:- initialization(main).
:- dynamic(known/3).

The gplc utility will report an error without the dynamic/1 directive. Running foo.exe will print:

$ ./foo.exe
Welcome to Micro-Computer troubleshooting
Please do not forget to type all your answers with a period(.) in the end

What is the problem?
1 : Audio Sound Card not detected
2 : Audio Driver Warning
3 : Scratchy Sound
4 : Num lock stays off at startup
5 : Invalid Drive Specification Error
6 : Mouse Pointer Jerks Onscreen
7 : System Cant find my Hard Drive
8 : Random shutdown when working on computer
9 : computer freezes randomly
10 : Blue-screens
11 : Monitor is blank
Enter the number of choice> 

P.S. GNU Prolog is one of the few available Prolog compilers that can generate a true .exe file that you can distribute to others without requiring them to also have GNU Prolog installed.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!