XPCE Prolog 命令在 VS2008 C++ 中导致错误
将包含命令“发送”(xpce 图形)的 Prolog 程序加载到 C++ 程序中时,我收到以下类型的错误消息:
Syntax Error: Operator Expected.
这是导致错误的示例命令:
send( Dialog, append, button(continue, message(@prolog, clear_my_blackboard)) ),
当我使用 plld 时,我曾经遇到过相同的错误.exe 实用程序,用于连接 C++ 和 Prolog 程序。当时,我认为问题在于 plld 由于某种原因与 xpce 显卡不兼容。
但现在我使用以下命令查阅(加载)我的 Prolog 源文件到我的 C++ 文件中:
PlCall( "consult(myPrologFile.pl)" );
我仍然收到这些错误消息。我可以注释掉包含 xpce 特定命令的行,但我更想知道问题是什么以及如何解决它。所以,我将不胜感激任何帮助。
干杯,
Upon loading into a C++ program a Prolog program that contains the command 'send' (xpce graphics), I get error messages of type:
Syntax Error: Operator Expected.
Here is an example command that causes the errors:
send( Dialog, append, button(continue, message(@prolog, clear_my_blackboard)) ),
I used to get the same errors when I used the plld.exe utility for interfacing my C++ and Prolog programs. At the time, I thought the problem was that plld was for some reason incompatible with xpce graphics.
But now that I consult (load) my Prolog source files into my C++ files using:
PlCall( "consult(myPrologFile.pl)" );
I still get these error messages. I could comment out the lines that contain xpce-specific commands, but I'd rather know what the problem is and how I can circumnavigate it. So, I would appreciate any help.
Cheers,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@显然是未知的!
它由SWI主目录中的'rc'文件加载并实现XPCE绑定。我应该手动加载它,使用:
我的所有 pl 和 xpce 源文件都已成功编译。
我正在连接 C++ 和 Prolog,以将用 Prolog 编写的认知架构连接到用 C++ 编写的机器人模拟器。我使用的是 SWI 版本 5.8.0,因此我必须在 C++ 程序中使用以下行来实现此目的:
此命令的结果是:
感谢 Jan Wielemaker。
@ is apparently unknown!
It is loaded by the 'rc' file in the SWI home dir and realizes the XPCE binding. I should load this by hand, using:
All my pl and xpce source files were compiled successfully.
I am interfacing C++ and Prolog to connect a cognitive architecture written in Prolog to a robotic simulator written in C++. I am using SWI version 5.8.0 so I had to use the following line in my C++ program to achieve that:
This command resulted in:
Thanks to Jan Wielemaker.