Thread overview
Linking errors to Newton headers
Oct 03, 2007
Anders Johnsen
Oct 03, 2007
Anders Johnsen
Oct 03, 2007
Anders Johnsen
Oct 03, 2007
Bill Baxter
Oct 04, 2007
Carlos Santander
October 03, 2007
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.o):(.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._ZTI17dgConvexCollision[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._ZTV17dgConvexCollision[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._ZTV17dgConvexCollision[vtable for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
/usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.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
October 03, 2007
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.o):(.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._ZTI17dgConvexCollision[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._ZTV17dgConvexCollision[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._ZTV17dgConvexCollision[vtable for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.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

October 03, 2007
"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.o):(.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._ZTI17dgConvexCollision[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._ZTV17dgConvexCollision[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._ZTV17dgConvexCollision[vtable
> for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.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.


October 03, 2007
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.o):(.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._ZTI17dgConvexCollision[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._ZTV17dgConvexCollision[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._ZTV17dgConvexCollision[vtable
> > for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
> > /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.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.
> 
> 

October 03, 2007
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
October 04, 2007
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.o):(.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._ZTI17dgConvexCollision[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._ZTV17dgConvexCollision[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._ZTV17dgConvexCollision[vtable for dgConvexCollision]+0x54): undefined reference to `__cxa_pure_virtual'
> /usr/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libNewton.a(dgConvexCollision.o):(.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