[solved] bullet compilation issue

madMAx4
Posts: 27
Joined: Fri Apr 20, 2007 7:29 pm
Location: Germany

[solved] bullet compilation issue

Post by madMAx4 »

Hi,
when i try to compile bullet with g++-3.4.6 or g++-4.1.1 i get the following errors:

Code: Select all

In file included from /mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h:25,
                 from /mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/btCollisionWorld.h:73,
                 from /mnt/kk/devel/bullet-2.50b/src/btBulletCollisionCommon.h:22,
                 from /mnt/kk/devel/bullet-2.50b/src/btBulletDynamicsCommon.h:20,
                 from test04.cpp:6:
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h: In member function `void btAlignedObjectArray<T>::destroy(int, int)':
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:58: error: expected class-name before '(' token
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:58: error: `model' was not declared in this scope
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:58: error: expected primary-expression before ')' token
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h: In member function `void btAlignedObjectArray<T>::pop_back()':
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:125: error: expected class-name before '(' token
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:125: error: `model' was not declared in this scope
/mnt/kk/devel/bullet-2.50b/src/BulletCollision/CollisionDispatch/../../LinearMath/btAlignedObjectArray.h:125: error: expected primary-expression before ')' token
make: *** [all] Error 1
same with new 2.50b

i used to comment these lines out:

Code: Select all

btAlignedObjectArray.h line 58:

m_data[i].~T();
and

Code: Select all

btAlignedObjectArray.h line 125:

m_data[m_size].~T();
i think gcc doesn't compete with the syntax.

so is there any other way to do that?
Last edited by madMAx4 on Thu Apr 26, 2007 9:09 am, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Which platform are you compiling on? What STL version is installed?

Can you report the compiler/STL versions implementation of vector::destroy for your platform?

Also, can you try to replace
m_data.~T();
by
m_data.T::~T();

Does that help?
Thanks,
Erwin
madMAx4
Posts: 27
Joined: Fri Apr 20, 2007 7:29 pm
Location: Germany

Post by madMAx4 »

thx for your reply,

i'm compiling under gentoo linux with libstdc++ v3.3.4
compiler is as said above gcc-i686-pc-linux-gnu-3.4.6.

i forgot to say that this error only occurs when i include "btBulletDynamicsCommon.h" into my project.
compilation of the library works without any error.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

i forgot to say that this error only occurs when i include "btBulletDynamicsCommon.h" into my project.
compilation of the library works without any error
That is an important detail, so it seems to be a conflict with your source code/other includes.

Can you put the #include "btBulletDynamicsCommon.h" at the very first line of your .cpp source file, and see if that helps? Try to avoid including it in another header file.

Thanks,
Erwin
madMAx4
Posts: 27
Joined: Fri Apr 20, 2007 7:29 pm
Location: Germany

Post by madMAx4 »

yeah it's working now, thx. i put

Code: Select all

#include "btBulletDynamicsCommon.h"
#include "btBulletCollisionCommon.h"
at the top of my .cpp as you said.

at first, these includes were above them:

Code: Select all

//irrlicht
#include "irrlicht.h"

//common
#include <iostream>
#include "glm.c"
#include <wchar.h>