作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我粘贴了 SICStus Prolog 4.3.3 SP_define_c_predicate()
按原样采样——然后……失败:
$ /usr/local/sicstus4.3.3/bin/splfr square.pl square.csquare.c: In function ‘square_it’:square.c:7:3: error: unknown type name ‘SP_WORD’ SP_WORD arg1; ^square.c:13:3: warning: passing argument 2 of ‘sp_GlobalSICStus_square->dispatch_API_SICSTUS_H->pSP_get_integer’ from incompatible pointer type [enabled by default] if (!SP_get_integer(tmp,&arg1)) ^square.c:13:3: note: expected ‘SP_integer *’ but argument is of type ‘int *’Uncaught exception from user code: ! Could not compile square.c
到目前为止,我为 SP_WORD
搜索了 SICStus C 包含文件——但没有用。
您是否有一些提示让我可以让它发挥作用?提前致谢!
(仅供引用:我使用的是 x86-64 Linux Mint 17 和 gcc 版本 4.8.4。)
最佳答案
示例应该使用 SP_integer
而不是内部类型 SP_WORD
。
关于prolog - 替代 SICStus Prolog FFI SP_define_c_predicate(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38341729/
我粘贴了 SICStus Prolog 4.3.3 SP_define_c_predicate()按原样采样——然后……失败: $ /usr/local/sicstus4.3.3/bin/splfr
我是一名优秀的程序员,十分优秀!