Hi I am trying to imploment Box2D with DragonfireSDK(Iphone development in c++) and I came across this problem:
this is the error and below is the code
1>c:\users\oskar\desktop\ipaaad\app.cpp(23): error C2661: 'b2World::b2World' : no overloaded function takes 3 arguments
1>c:\users\oskar\desktop\ipaaad\app.cpp(30): error C2228: left of '.CreateBody' must have class/struct/union
1> type is 'b2World *'
1> did you intend to use '->' instead?
this is the error and below is the code
1>c:\users\oskar\desktop\ipaaad\app.cpp(23): error C2661: 'b2World::b2World' : no overloaded function takes 3 arguments
1>c:\users\oskar\desktop\ipaaad\app.cpp(30): error C2228: left of '.CreateBody' must have class/struct/union
1> type is 'b2World *'
1> did you intend to use '->' instead?
Code:
//====================================================
// App.cpp
//====================================================
#include "DragonFireSDK.h"
#include <iostream>
#include <Box2D.h>
int LogoImage;
int LogoView;
void AppMain()
{
int scale(30);
b2AABB worldAABB;
worldAABB.lowerBound.Set(-1000/scale,-1000/scale);
worldAABB.upperBound.Set(1000/scale,1000/scale);
bool doSleep = true;
b2Vec2 gravity(0.0f, 10.0f);
LandscapeMode();
b2World* world;
world=new b2World(worldAABB,gravity,doSleep);
b2BodyDef groundBodyDef;
groundBodyDef.position.Set(0.0f, -10.0f);
b2Body* groundBody = world.CreateBody(&groundBodyDef);
b2PolygonShape groundBox;
groundBox.SetAsBox(50.0f, 10.0f);
groundBody->CreateFixture(&groundBox, 0.0f);
}
void AppExit()
{
}
void OnTimer()
{
}
thanks in advance!// App.cpp
//====================================================
#include "DragonFireSDK.h"
#include <iostream>
#include <Box2D.h>
int LogoImage;
int LogoView;
void AppMain()
{
int scale(30);
b2AABB worldAABB;
worldAABB.lowerBound.Set(-1000/scale,-1000/scale);
worldAABB.upperBound.Set(1000/scale,1000/scale);
bool doSleep = true;
b2Vec2 gravity(0.0f, 10.0f);
LandscapeMode();
b2World* world;
world=new b2World(worldAABB,gravity,doSleep);
b2BodyDef groundBodyDef;
groundBodyDef.position.Set(0.0f, -10.0f);
b2Body* groundBody = world.CreateBody(&groundBodyDef);
b2PolygonShape groundBox;
groundBox.SetAsBox(50.0f, 10.0f);
groundBody->CreateFixture(&groundBox, 0.0f);
}
void AppExit()
{
}
void OnTimer()
{
}