Suppose I have the program below:
#include files
PREDICATE( add, 3 )
{
return A3 = (long)A1 + (long)A2;
}
Type: Posts; User: HJoshy
Suppose I have the program below:
#include files
PREDICATE( add, 3 )
{
return A3 = (long)A1 + (long)A2;
}
Could someone please tell me what I am doing wrong that I get this Unhandled Exception error message:
0xC0000005: Access violation reading location 0x0000000c.
with a green pointer...
Have attended to my replies and revised my code.
Now, I was wondering if someone could tell me what I am doing wrong that I get this Unhandled Exception error message:
0xC0000005: Access...
I have included the complete programs for Hanoi, Factorial, and Backtracking below. I hope beginners will benefit from them. If anybody is not sure about VS2008 settings for interfacing C++ and...
.
I have tried that, believe it or not!
I have tried all the examples in the SWI manual, including the foreign_t and PL_open_frame to no avail in this Robotics program in VS2008.
I am in...
.
OK, thanks. That was useful. I left:
PL_initialise( 1, argv );
and got rid of the other 'if' check statement.
Good point tabstop, but what do you mean by "ust save the return code from the first time into a variable" ?
Thanks tabstop.
I made my argv a fixed-size array of characters, but the error message is persistent...
Original:
I am interfacing C++ and Prolog and I am trying to avoid the plld utility...
How do I do that, given that I am using the above as a Prolog engine initializer?
I'm actually trying to avoid plld and foreign_t complications by loading my Prolog sources and initializing them...
Does anyone know why including a term such as:
t = PL_new_term_ref();
would cause an Unhandled Exception error message:
0xC0000005: Access violation reading location 0x0000000c.
Could someone please guide me through backtracking in Prolog-C using the simple example below?
Here is my Prolog file:
likes( john, mary ).
likes( john, emma ).
likes( john,...
# include files
term_t tf;
term_t tx;
term_t goal_term;
functor_t goal_functor;
int main( int argc, char** argv )
{
argv[0] = "libpl.dll";
*
@ 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:
consult( swi( 'plwin.rc' ) )
All my pl...
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...
I would like to work out a number's factorial. My factorial rule is in a Prolog file and I am connecting it to a C++ file. Can someone please tell me what is wrong with my interfacing C++ to...
I would like to work out a number's factorial. My factorial rule is in a Prolog file and I am connecting it to a C++ code. Can someone tell me what is wrong with my C++ interface please?
...
I have a large Prolog program with lots of predicates. I need to connect to this Prolog code from C++ (VS2008) to obtain certain query results. So I am not trying to embed Prolog in C++ as a logicasl...
I have a C++ application (prog.sln) which is my main program and I want to use Prolog as an embedded logic server (hanoi.pl)
int main(int argc, char** argv)
{
putenv( "SWI_HOME_DIR=C:\\Program...
Thanks for letting me know.
Actually, mine works fine too, but because I get an error message that indicates my Prolog code is not consulted, I thought perhaps I needed to add pl\bin to my PATH.
...
Guys,
How do I add:
pl\bin
to my VS2008 PATH?
I read in a forum post: . . . ensure pl\bin is in %PATH%
By 'consult' I mean compiling my Prolog program.
The program return something when you type in, say, hanoi(5).
hanoi( N ):-
move( N, left, middle, right ).
move( 0, _, _, _ ):-
I have a Prolog file (Hanoi.pl) containing the code for solving the Hanoi Towers puzzle:
hanoi( N ):-
move( N, left, middle, right ).
move( 0, _, _, _ ):-
!.
move(...
How do I add Prolog DLLs to VS2008 in order to embed Prolog within C++?
Are these three dlls sufficient:
libpl.lib
plterm.lib
pthreadVC.lib
Thanks,
My question is concerning argv[0].
I know (in theory) that on Unix, this argument passes the part of the command-line that is used to locate the executable. Prolog uses this to find the file...
I added these lines:
#pragma comment(lib, "libpl.lib")
#pragma comment(lib, "plterm.lib")
#pragma comment(lib, "pthreadVC.lib")
#pragma comment(dll, "libpl.dll")
#pragma...