Box2D Forums

It is currently Tue May 21, 2013 10:34 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Linking issue..
PostPosted: Fri Sep 11, 2009 2:02 pm 
Offline

Joined: Fri Sep 11, 2009 1:54 pm
Posts: 5
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??


Top
 Profile  
 
 Post subject: Re: Linking issue..
PostPosted: Sat Sep 12, 2009 3:14 pm 
Offline

Joined: Sun May 24, 2009 7:43 am
Posts: 107
Location: Quebec, Canada
If 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.


Top
 Profile  
 
 Post subject: Re: Linking issue..
PostPosted: Sat Sep 12, 2009 9:00 pm 
Offline

Joined: Fri Sep 11, 2009 1:54 pm
Posts: 5
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:

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)


@Tiblanc: Thanks for the reply.. I am not using the box2d library but have included the source code in my project..


Top
 Profile  
 
 Post subject: Re: Linking issue..
PostPosted: Sun Sep 13, 2009 5:38 pm 
Offline

Joined: Fri Sep 11, 2009 1:54 pm
Posts: 5
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..


Top
 Profile  
 
 Post subject: Re: Linking issue..
PostPosted: Sun Sep 13, 2009 5:52 pm 
Offline

Joined: Fri Sep 11, 2009 1:54 pm
Posts: 5
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group