build with .lib

ekba89
Posts: 1
Joined: Mon Dec 19, 2011 6:23 pm

build with .lib

Post by ekba89 »

First i was using bullet by including bullet projects as described in the tutorial. And it was working fine then since i don't need to see bullet projects i created .libs and tried to use bullet with .libs but now i get following error.

Code: Select all

1>BulletCollision.lib(btBoxShape.obj) : error LNK2005: "public: __thiscall btBoxShape::btBoxShape(class btVector3 const &)" (??0btBoxShape@@QAE@ABVbtVector3@@@Z) already defined in BoxBody.obj
1>..\..\Skeleton\DXTEST.exe : fatal error LNK1169: one or more multiply defined symbols found
And here classes that are causing problem

Code: Select all

#pragma once
#include "PhysicalBody.h"

class BoxBody : public PhysicalBody
{
public:
	BoxBody(float extent, float _mass, D3DXVECTOR3 origin);
	BoxBody(D3DXVECTOR3 extents, float _mass, D3DXVECTOR3 origin);
};

Code: Select all

#pragma once
#include "BulletToDX.h"

class PhysicalBody
{
public:
	PhysicalBody(void);
	~PhysicalBody(void);

	D3DXVECTOR3 GetOrigin();
	D3DXMATRIX GetRotationMatrix();
	D3DXMATRIX GetTransformMatrix();

	btRigidBody* rigidBody;

protected:
	float mass;
	btCollisionShape* collisionShape;
	btMotionState* motionState;
	btVector3 origin;
};

Code: Select all

#pragma  once
#include <d3dx9.h>
#include <btBulletDynamicsCommon.h>

D3DXVECTOR3 BT2DX_VECTOR3(const btVector3 &v);

btVector3 DX2BT_VECTOR3(const D3DXVECTOR3& v);

D3DXQUATERNION BT2DX_QUATERNION(const btQuaternion &q);

D3DXMATRIX BT2DX_MATRIX(const btTransform &ms);
Thanks.