Thread: XPCE Prolog command causing error in VS2008 C++

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    26

    XPCE Prolog command causing error in VS2008 C++

    Upon loading into a C++ program a Prolog program that contains the command 'send' (xpce graphics), I get error messages of type:

    Code:
    Syntax Error: Operator Expected.
    Here is an example command that causes the errors:

    Code:
    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:

    Code:
    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,
    .
    .
    .

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    26
    *

    @ 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:

    Code:
    consult( swi( 'plwin.rc' ) )
    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:

    Code:
    PlCall( "consult( swi( 'plwin.rc' ) )" );
    This command resulted in:

    Code:
    swi(plwin.rc) compiled into link_xpce
    Thanks to Jan Wielemaker.

    *

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. plld Prolog VS2008
    By HJoshy in forum C++ Programming
    Replies: 0
    Last Post: 04-01-2010, 10:26 AM

Tags for this Thread