Page 1 of 1

Bug (or user error?) compiling with G++, SVN bullet

Posted: Sun Aug 17, 2014 12:17 pm
by djvs
$ g++ main.cpp -o part1 -I/usr/local/include/bullet

/tmp/ccJjRcPr.o: In function `btTypedConstraint::operator delete(void*)':
main.cpp:(.text._ZN17btTypedConstraintdlEPv[btTypedConstraint::operator delete(void*)]+0x14): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccJjRcPr.o: In function `btAlignedAllocator<int, 16u>::deallocate(int*)':
main.cpp:(.text._ZN18btAlignedAllocatorIiLj16EE10deallocateEPi[btAlignedAllocator<int, 16u>::deallocate(int*)]+0x18): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccJjRcPr.o: In function `btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*)':
main.cpp:(.text._ZN18btAlignedAllocatorI9btHashIntLj16EE10deallocateEPS0_[btAlignedAllocator<btHashInt, 16u>::deallocate(btHashInt*)]+0x18): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccJjRcPr.o: In function `btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*)':
main.cpp:(.text._ZN18btAlignedAllocatorI14btTriangleInfoLj16EE10deallocateEPS0_[btAlignedAllocator<btTriangleInfo, 16u>::deallocate(btTriangleInfo*)]+0x18): undefined reference to `btAlignedFreeInternal(void*)'
/tmp/ccJjRcPr.o:(.rodata._ZTV17btTypedConstraint[vtable for btTypedConstraint]+0x60): undefined reference to `btTypedConstraint::serialize(void*, btSerializer*) const'
collect2: ld returned 1 exit status
make: *** [all] Error 1
on trying to compile very basic:
#include <btBulletDynamicsCommon.h>
int main (){
return 0;
}
Maybe a dumb error on my part?

Re: Bug (or user error?) compiling with G++, SVN bullet

Posted: Mon Aug 18, 2014 2:00 am
by c6burns
You aren't linking against the bullet libs (LinearMath in this case) and as a result you have undefined references