我想下MAC OS X到SWI-Prolog的使用的XCode IDE从C代码接口。
从来就包括在头文件和使用下面的示例代码:
#include <stdio.h>
#include <SWI-Prolog.h>
#include <SWI-Stream.h>
int main(int argc, const char * argv[])
{
char *av[10];
int ac = 0;
av[ac++] = "/opt/local/lib/swipl-6.2.2/bin/i386-darwin12.2.1/swipl";
av[ac++] = "-x";
av[ac++] = "mystate";
av[ac] = NULL;
#ifdef READLINE /* Remove if you don't want readline */
PL_initialise_hook(install_readline);
#endif
if ( !PL_initialise(ac, av) )
PL_halt(1);
PL_halt(PL_toplevel() ? 0 : 1);
printf("done...\n");
return 0;
}
我还挂在构建设置页眉和lib路径:
标题搜索路径:/opt/local/lib/swipl-6.2.2/include
库搜索路径:/opt/local/lib/swipl-6.2.2/lib/i386-darwin12.2.1
但运行代码时我得到以下错误:
Undefined symbols for architecture x86_64:
"_PL_halt", referenced from:
_main in main.o
"_PL_initialise", referenced from:
_main in main.o
"_PL_toplevel", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有谁可以帮我把我的代码的运行?
在此先感谢和亲切的问候
Solick