www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linking errors to Newton headers

reply Anders Johnsen <skabet gmail.com> writes:
Hey,

I'm playing around with a bit of OpenGL in D, and decided to add some physics.
I choose Newton, but I'm having a few problems linking it.

When i compile i use:

dsss build -llNewton

It finds the file alright, but i get a TON of error like:

/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.o):(.gnu.linkonce.r.
ZTI6dgFile[typeinfo for dgFile]+0x0): undefined reference to `vtable for
__cxxabiv1::__class_type_info'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.
):(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTI17dgConv
xCollision[typeinfo for dgConvexCollision]+0x0): undefined reference to `vtable
for __cxxabiv1::__si_class_type_info'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x28): undefined reference to
`__cxa_pure_virtual'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x54): undefined reference to
`__cxa_pure_virtual'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.
):(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

I've kind a lost my head in this. Maybe it's just a small thing that i've
forgotten, but i'm not sure what...

Hope someone got an idea.

Thanks,
Anders johnsen 
Oct 03 2007
next sibling parent Anders Johnsen <skabet gmail.com> writes:
Ohh yeah, forgot to say. I build the Newton.d file with htod from the Newton.h
file.

Anders Johnsen Wrote:

 Hey,
 
 I'm playing around with a bit of OpenGL in D, and decided to add some physics.
I choose Newton, but I'm having a few problems linking it.
 
 When i compile i use:
 
 dsss build -llNewton
 
 It finds the file alright, but i get a TON of error like:
 
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.o):(.gnu.linkonce.r.
ZTI6dgFile[typeinfo for dgFile]+0x0): undefined reference to `vtable for
__cxxabiv1::__class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.
):(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTI17dgConv
xCollision[typeinfo for dgConvexCollision]+0x0): undefined reference to `vtable
for __cxxabiv1::__si_class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x28): undefined reference to
`__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x54): undefined reference to
`__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.
):(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
 
 I've kind a lost my head in this. Maybe it's just a small thing that i've
forgotten, but i'm not sure what...
 
 Hope someone got an idea.
 
 Thanks,
 Anders johnsen 
Oct 03 2007
prev sibling next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Anders Johnsen" <skabet gmail.com> wrote in message 
news:fe03f2$rol$1 digitalmars.com...

 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.o):(.gnu.linkonce.r.
ZTI6dgFile[typeinfo 
 for dgFile]+0x0): undefined reference to `vtable for 
 __cxxabiv1::__class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.
):(.eh_frame+0x11): 
 undefined reference to `__gxx_personality_v0'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTI17dgConv
xCollision[typeinfo 
 for dgConvexCollision]+0x0): undefined reference to `vtable for 
 __cxxabiv1::__si_class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable 
 for dgConvexCollision]+0x28): undefined reference to `__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable 
 for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.
):(.eh_frame+0x12): 
 undefined reference to `__gxx_personality_v0'
Looks like Newton's written in C++. Does it have a C interface? Because if it uses a C++ interface, you're going to have to use BCD.gen, if anything, to bind to it.
Oct 03 2007
parent reply Anders Johnsen <skabet gmail.com> writes:
I'm pretty sure it's C interface. At least it doesn't have any classes in the
header(only structs).

Jarrett Billingsley Wrote:

 "Anders Johnsen" <skabet gmail.com> wrote in message 
 news:fe03f2$rol$1 digitalmars.com...
 
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.o):(.gnu.linkonce.r.
ZTI6dgFile[typeinfo 
 for dgFile]+0x0): undefined reference to `vtable for 
 __cxxabiv1::__class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.
):(.eh_frame+0x11): 
 undefined reference to `__gxx_personality_v0'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTI17dgConv
xCollision[typeinfo 
 for dgConvexCollision]+0x0): undefined reference to `vtable for 
 __cxxabiv1::__si_class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable 
 for dgConvexCollision]+0x28): undefined reference to `__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable 
 for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.
):(.eh_frame+0x12): 
 undefined reference to `__gxx_personality_v0'
Looks like Newton's written in C++. Does it have a C interface? Because if it uses a C++ interface, you're going to have to use BCD.gen, if anything, to bind to it.
Oct 03 2007
parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Anders Johnsen wrote:
 I'm pretty sure it's C interface. At least it doesn't have any classes in the
header(only structs).
 
Yes it's definitely C. Htod is really not very smart. It may have botched the translation. I have Newton installed -- what was the command line you used for htod? Straight up "htod Newton.h" just gave me errors. --bb
Oct 03 2007
prev sibling parent Carlos Santander <csantander619 gmail.com> writes:
Anders Johnsen escribió:
 Hey,
 
 I'm playing around with a bit of OpenGL in D, and decided to add some physics.
I choose Newton, but I'm having a few problems linking it.
 
 When i compile i use:
 
 dsss build -llNewton
 
 It finds the file alright, but i get a TON of error like:
 
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.o):(.gnu.linkonce.r.
ZTI6dgFile[typeinfo for dgFile]+0x0): undefined reference to `vtable for
__cxxabiv1::__class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgFile.
):(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTI17dgConv
xCollision[typeinfo for dgConvexCollision]+0x0): undefined reference to `vtable
for __cxxabiv1::__si_class_type_info'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x28): undefined reference to
`__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.gnu.linkonce.r._ZTV17dgCo
vexCollision[vtable for dgConvexCollision]+0x54): undefined reference to
`__cxa_pure_virtual'
 /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.
):(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
 
 I've kind a lost my head in this. Maybe it's just a small thing that i've
forgotten, but i'm not sure what...
 
 Hope someone got an idea.
 
 Thanks,
 Anders johnsen 
Try linking with stdc++ (-llstdc++ ?) -- Carlos Santander Bernal
Oct 03 2007