Question

I have troubles working in cocos2d-x v3. Actually, I want to init box2d world object. I have created my game project properly, as it was given in cocos2d-x manual. Now what's the trouble:

b2Vec2 gravity = b2Vec2(0.0f, -10.0f);
b2World world(gravity);

In this code the second line gives the compiler

'unresolved external symbol error':(

Without instantinating b2World object, everything compiles and works fine.

Have anybody faced this problem?

Was it helpful?

Solution

This is a very common linker error in Visual Studio and you have to add libbox2d.lib in your project properties.

Right Click Project -> Project Properties -> Linker -> Input -> Additional Dependencies

Now edit and add libbox2d.lib at the end and run project again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top