|
From: Narayan A. <nan...@ly...> - 2002-12-17 01:02:00
|
Hi all,
I am trying to execute a c++ code that sends queries to a prolog engine back and forth. I got the following linker error when i tried to compile the code:
C:\DOCUME~1\NARAYA~1.CAM\LOCALS~1\Temp\ccqubaaa.o: In function `_7PlTermvG6PlTermT1':
//C/PROGRA~1/pl/include/SWI-cpp.h(.text$__as__6PlTermPCc+0x16): undefined reference to `PL_unify_atom_chars'
//C/PROGRA~1/pl/include/SWI-cpp.h(.text$__7PlTermvi+0x13): undefined reference to `PL_new_term_refs'
//C/PROGRA~1/pl/include/SWI-cpp.h(.text$__7PlFrame+0xb): undefined reference to `PL_open_foreign_frame'
//C/PROGRA~1/pl/include/SWI-cpp.h(.text$_$_7PlFrame+0x15): undefined reference to `PL_close_foreign_frame'
//C/PROGRA~1/pl/include/SWI-cpp.h(.text$__7PlQueryPCcRC7PlTermv+0x20): undefined reference to `PL_predicate'
...
...
...
My code is as follows:
#include <SWI-Prolog.h>
#include <SWI-cpp.h>
#include <string>
#include <iostream.h>
void loadit(){
PlFrame fr;
PlTermv av(1);
av[0] = "test.pl";
PlQuery q("consult", av);
q.next_solution();
}
void start(){
PlFrame fr;
PlTermv av(1);
av[0] = "Narayan";
PlQuery q("receive", av);
q.next_solution();
}
int main( int argc, char *argv[] )
{
PlEngine e(argv[0]);
loadit();
start();
cerr << "Prolog initialized" << endl;
return 0;
}
It throws unreferenced errors to all the prolog terms that I have used in the program.
I have set the compiler options in the following way:
C++ incluce directories: <default>, include directory containing prolog header files
Library files: <default>, library containg prolog dll files.
Could anybody advice me on what I am missing here:
Thanks,
Narayan.
_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus
|