'printout' CLIPS 缺少函数声明

Missing function declaration for 'printout' CLIPS

我有一个用 C++ 编写的可执行文件/MacOS 使用 clips 命令并 运行 它使用 clips.h 函数。可执行文件在我的 Mac 上运行完美,但是一旦我尝试 运行 相同的 clips 命令,我就遇到了错误。

我搜索了任何可能有帮助的东西,但我找不到真正有用的东西。

命令很简单,功能应该已经内置clips

这是我正在加载的文件。

(defrule QPain
   =>
   (printout t "Are You In Pain? ") 
   (bind ?answer (read))
   (if (eq ?answer y)
      then
      (bind ?*symcount* (+ ?*symcount* 1))))

这是我的 C++ 代码,

#ifdef __cplusplus
extern "C" {
#endif
#include "clips.h"
#ifdef __cplusplus
}
#endif

#include <string>
#include <iostream>

using namespace std;

int main() {
    Environment* env = NULL;
    env = CreateEnvironment();
    SetConserveMemory(env, true);
    ReleaseMem(env, 0);
    Load(env, "/path/to/clp/file/above");
    Reset(env);
    Run(env, -1);
return 0;
}

对于上面的代码,我遇到了两个错误:

我错过了什么?即使我正在使用 clips.h 函数,我是否需要在 Linux 上为 运行 宁这样的命令安装任何库??

我将这篇文章发布给将来可能遇到同样问题或可以提供任何帮助的任何人。

我使用 gcc 编译器编译剪辑,带有以下标志:

-O3 -g -pipe -pedantic -std=gnu99 -fno-strict-aliasing -DIO_FUNCTIONS=0 -c

在深入阅读高级编程指南和每个标志功能后,我发现一个名为 BASIC_IO 的标志用于转换 on/off input/output 功能(打印输出、打开、..、等),所以根据指南,我已经更改了标志 DIO_FUNCTIONS = 1 并重新编译了剪辑文件,因此问题得到了解决。

注意:标志名称的差异可能与剪辑版本和编译器版本有关。

感谢所有帮助解决此问题的人。