【问题标题】:Is there way I could fix this error ? Undefined symbols for architecture x86_64: (gnu-prolog)有没有办法解决这个错误?架构 x86_64 的未定义符号:(gnu-prolog)
【发布时间】:2019-11-07 02:28:13
【问题描述】:

我的程序在 swi prolog 上运行良好,但是当我尝试使用 gnu-prolog 运行它时。它没有成功运行。我收到这个错误,我不知道如何解决。

这是我的第一个错误

gprolog [我的项目名称]

?- ran the program calling the function
uncaught exception: error(existence_error(procedure,writeln/1),comp/0)

我在一行中运行它没有工作

我尝试在终端上以不同的方式运行它 gplc [我的项目名称]

gplc [我的项目名称]

Undefined symbols for architecture x86_64:
  "predicate(writeln/1)", referenced from:
      predicate(comp/2) in gplcML9Z1g.o
      _Lpred2_1 in gplcML9Z1g.o
      _Lpred2_2 in gplcML9Z1g.o
      _Lpred2_3 in gplcML9Z1g.o
  _Lpred2_4 in gplcML9Z1g.o

ld:未找到架构 x86_64 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) 编译失败

【问题讨论】:

    标签: prolog gnu-prolog


    【解决方案1】:

    writeln/1 谓词不是标准谓词,在 GNU Prolog 中不受支持。将其替换为标准谓词 write/1nl/0 的组合。

    【讨论】:

      猜你喜欢
      • 2020-02-18
      • 2017-02-15
      • 1970-01-01
      • 2015-10-27
      • 1970-01-01
      • 2014-05-14
      • 2016-05-31
      • 2016-12-12
      • 1970-01-01
      相关资源
      最近更新 更多