Hey.. i am trying to compile box2d not as a static library but the source is included in my project as i need to do a bit of tampering with it.. it was working fine but i just changed a few things here and there and from nowhere i get an unresolved external symbol error.. i am using the hello world code and it says two functions b2PolygonDef::SetAsBox and b2World::step are unresolved external symbols where as they are included in the project itself.. undoing all my previous actions and stuff has no effect on this error :S.. and when i try to find the definition of both these functions it takes me right to the source and yet it doesnt build.. any suggestions??
Linking issue..
Build IssuesIf you have multiple versions of the library on your computer, your compiler might be using one version's .h files with another version's .lib file. Check your paths to make sure you point to the correct version.
Im back with some more data to help myself out.. Turns out the problem occurs only when TARGET_FLOAT32_IS_FIXED is defined.. i have compiled my game perfectly using normal floats and not fixed types and its working fine.. but if i define the fixed type it gives me exactly the following errors:
@Tiblanc: Thanks for the reply.. I am not using the box2d library but have included the source code in my project..
Quote:
PhySoundTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall b2PolygonDef::SetAsBox(class Fixed,class Fixed)" (?SetAsBox@b2PolygonDef@@QAEXVFixed@@0@Z) referenced in function "public: void __thiscall CGame::init(struct ECD *)" (?init@CGame@@QAEXPAUECD@@@Z)
PhySoundTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall b2World::Step(class Fixed,int,int)" (?Step@b2World@@QAEXVFixed@@HH@Z) referenced in function "public: void __thiscall CGame::render(void)" (?render@CGame@@QAEXXZ)
PhySoundTest.obj : error LNK2019: unresolved external symbol "public: void __thiscall b2World::Step(class Fixed,int,int)" (?Step@b2World@@QAEXVFixed@@HH@Z) referenced in function "public: void __thiscall CGame::render(void)" (?render@CGame@@QAEXXZ)
@Tiblanc: Thanks for the reply.. I am not using the box2d library but have included the source code in my project..
Sorry for the wrong thread mods, but i am basically porting box2d to symbian and windows mobile so i posted in the porting section due to that..
neways, as for my problem i am defining TARGET_FLOAT32_IS_FIXED in main.cpp, but if i set it as a pre-processor directive then i am able to compile the game, but as soon as it runs i get an assert fail on this line:
b2Assert(edge.LengthSquared() > B2_FLT_EPSILON * B2_FLT_EPSILON);
where the b2_flt_epsilon value is the fixed value Fixed(0.00007f) .. and the game runs fine when not in fixed mode..
Can someone just tell me, whether this fixed mode is stable enough to be used in a commercial game or is it more or less experimental and is prone to issues? If its stable enough then please help me out with this problem..
neways, as for my problem i am defining TARGET_FLOAT32_IS_FIXED in main.cpp, but if i set it as a pre-processor directive then i am able to compile the game, but as soon as it runs i get an assert fail on this line:
b2Assert(edge.LengthSquared() > B2_FLT_EPSILON * B2_FLT_EPSILON);
where the b2_flt_epsilon value is the fixed value Fixed(0.00007f) .. and the game runs fine when not in fixed mode..
Can someone just tell me, whether this fixed mode is stable enough to be used in a commercial game or is it more or less experimental and is prone to issues? If its stable enough then please help me out with this problem..
After searching around more i found out why the issue was occuring and all about fixed point.. thanks, and for future reference if anyone else has this problem read all 3 pages of this thread:
http://www.box2d.org/forum/viewtopic.php?f=3&t=544
http://www.box2d.org/forum/viewtopic.php?f=3&t=544
Original thread: https://box2d.org/forum/viewtopic.php?t=3685