users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling C++ files with gplc


From: Jay Bradley
Subject: Compiling C++ files with gplc
Date: Mon, 19 Feb 2001 13:00:18 +0000

I was wondering if anyone out there could help me. I'm sure someone must have 
come across this problem before.

I am trying to compile two files using gplc. One is a prolog file and compiles 
fine. The other is a C++ file and will compile but will not link.

I am using the command:

gplc -v --c-compiler g++ threeBody.c threeBrain.pl

where threeBody.c is the C++ file and threeBrain.pl is the prolog file.

I get the following (rather long) error message:

Note that it compiles fine but will not link. It will not even link with the 
C++ libraries by the looks of it. I also note that it uses gcc at the linking 
stage. I can't work out how to change this if it even matters.

address@hidden robots]$ gplc -v --c-compiler g++ threeBody.c threeBrain.pl
Prolog compiler (GNU Prolog) 1.2.1
By Daniel Diaz
Copyright (C) 1999,2000 Daniel Diaz
GNU Prolog comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Prolog
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING.

Path used: /usr/local/gprolog-1.2.1

*** Compiling

--- file: threeBody.c
g++ -mpentiumpro -malign-loops=2 -malign-jumps=2 -malign-functions=2 
-ffixed-ebx -c -I/usr/local/gprolog-1.2.1/include -o /tmp/gplcSscwZZ.o 
threeBody.c
In file included from /usr/include/iostream.h:31,
                 from threeBody.c:6:
/usr/include/streambuf.h: In method `ios::~ios()':
/usr/include/streambuf.h:485: warning: `void *' is not a pointer-to-object 
type

--- file: threeBrain.pl
pl2wam -o /tmp/gplcxjFE96.wam threeBrain.pl
wam2ma -o /tmp/gplcunUSMj.ma /tmp/gplcxjFE96.wam
delete /tmp/gplcxjFE96.wam
ma2asm -o /tmp/gplcLT45cw.s /tmp/gplcunUSMj.ma
delete /tmp/gplcunUSMj.ma
as -o /tmp/gplcCUNf6H.o /tmp/gplcLT45cw.s
delete /tmp/gplcLT45cw.s

*** Linking

gcc  -o threeBody /usr/local/gprolog-1.2.1/lib/obj_begin.o /tmp/gplcSscwZZ.o 
/tmp/gplcCUNf6H.o /usr/local/gprolog-1.2.1/lib/all_pl_bips.o 
/usr/local/gprolog-1.2.1/lib/all_fd_bips.o 
/usr/local/gprolog-1.2.1/lib/top_level.o 
/usr/local/gprolog-1.2.1/lib/debugger.o 
/usr/local/gprolog-1.2.1/lib/libbips_fd.a 
/usr/local/gprolog-1.2.1/lib/libengine_fd.a 
/usr/local/gprolog-1.2.1/lib/libbips_pl.a 
/usr/local/gprolog-1.2.1/lib/obj_end.o 
/usr/local/gprolog-1.2.1/lib/libengine_pl.a 
/usr/local/gprolog-1.2.1/lib/liblinedit.a -lm 
/tmp/gplcSscwZZ.o: In function `main':
/tmp/gplcSscwZZ.o(.text+0x52): undefined reference to `endl(ostream &)'
/tmp/gplcSscwZZ.o(.text+0x71): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x76): undefined reference to 
`ostream::operator<<(char const *)'
/tmp/gplcSscwZZ.o(.text+0x81): undefined reference to 
`ostream::operator<<(int)'
/tmp/gplcSscwZZ.o(.text+0x8c): undefined reference to 
`ostream::operator<<(char const *)'
/tmp/gplcSscwZZ.o(.text+0x97): undefined reference to 
`ostream::operator<<(int)'
/tmp/gplcSscwZZ.o(.text+0xa2): undefined reference to 
`ostream::operator<<(ostream &(*)(ostream &))'
/tmp/gplcSscwZZ.o(.text+0xb5): undefined reference to `Start_Prolog(int, char 
**)'
/tmp/gplcSscwZZ.o(.text+0xc5): undefined reference to `Find_Atom(char *)'
/tmp/gplcSscwZZ.o(.text+0xe2): undefined reference to `Pl_Query_Start(int, 
int, long *, int)'
/tmp/gplcSscwZZ.o(.text+0xf6): undefined reference to `Pl_Query_End(int)'
/tmp/gplcSscwZZ.o(.text+0xfe): undefined reference to `Reset_Prolog(void)'
/tmp/gplcSscwZZ.o(.text+0x10d): undefined reference to `Stop_Prolog(void)'
/tmp/gplcSscwZZ.o: In function `checkMessages(int)':
/tmp/gplcSscwZZ.o(.text+0x12c): undefined reference to `cin'
/tmp/gplcSscwZZ.o(.text+0x131): undefined reference to `ios::clear(int)'
/tmp/gplcSscwZZ.o(.text+0x13c): undefined reference to `cin'
/tmp/gplcSscwZZ.o(.text+0x141): undefined reference to `ios::eof(void) const'
/tmp/gplcSscwZZ.o(.text+0x15c): undefined reference to `cin'
/tmp/gplcSscwZZ.o(.text+0x161): undefined reference to 
`istream::operator>>(char *)'
/tmp/gplcSscwZZ.o(.text+0x1b4): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x1b9): undefined reference to 
`ostream::operator<<(char const *)'/tmp/gplcSscwZZ.o(.text+0x1c4): undefined 
reference to `ostream::operator<<(char const 
*)'/tmp/gplcSscwZZ.o(.text+0x1db): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x1e0): undefined reference to 
`ostream::operator<<(char const *)'/tmp/gplcSscwZZ.o(.text+0x1eb): undefined 
reference to `ostream::operator<<(char const 
*)'/tmp/gplcSscwZZ.o(.text+0x208): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x20d): undefined reference to 
`ostream::operator<<(char const *)'/tmp/gplcSscwZZ.o(.text+0x218): undefined 
reference to `ostream::operator<<(char const 
*)'/tmp/gplcSscwZZ.o(.text+0x228): undefined reference to `endl(ostream &)'
/tmp/gplcSscwZZ.o(.text+0x235): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x23a): undefined reference to 
`ostream::operator<<(char const *)'/tmp/gplcSscwZZ.o(.text+0x245): undefined 
reference to `ostream::operator<<(ostream &(*)(ostream &))'
/tmp/gplcSscwZZ.o(.text+0x250): undefined reference to `endl(ostream &)'
/tmp/gplcSscwZZ.o(.text+0x25d): undefined reference to `cout'
/tmp/gplcSscwZZ.o(.text+0x262): undefined reference to 
`ostream::operator<<(char const *)'/tmp/gplcSscwZZ.o(.text+0x26d): undefined 
reference to `ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status
compilation failed
deleting temporary files before exit
delete /tmp/gplcSscwZZ.o
delete /tmp/gplcSscwZZ.o
delete /tmp/gplcCUNf6H.o
delete /tmp/gplcCUNf6H.o
address@hidden robots]$

I'd be very grateful if anyone could help me.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]