Box2D Forums

It is currently Wed May 22, 2013 9:44 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Dec 30, 2007 3:12 pm 
Offline

Joined: Sun Dec 30, 2007 3:02 pm
Posts: 3
Hello!

Box2D is a fantastic library, thank you Erin for designing it! I've managed to play around with it a little, and it works like a charm. On my own computer. On others' machines, errors along the lines of:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

After hours of disappointing "solutions", it seems like the real answer is that I have to build my project using /MT instead of /MD. What confuses me though, is that I've read on this forum that Box2D won't work in /MD. Which is odd, because it does over here. I am using Visual C++ 2008 Express edition, if that wasn't apparent.

Anyhow, when I switch to /MT, I get various linker errors, and when I've removed them, I get this final and only message:

"box2d_d.lib(b2PairManager.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)"

Which I can't understand. So basically, that's my problem. How do I get rid of that linker error? Is it simple? Possible?

Help please -- shed some light onto this situation; I've been trying to kill this problem for hours now. I'm about to give up hope :(


Top
 Profile  
 
PostPosted: Sun Dec 30, 2007 5:36 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
Release Build:
/MT means the C release mode runtime library is statically linked
/MD means the C release mode runtime library is dynamically linked via DLL

Debug Build:
/MTd means the C debug mode runtime library is statically linked
/MDd means the C debug mode runtime library is dynamically linked via DLL

The Box2D code supports either setting. However, the Box2D project file has been setup for static linkage. AFAIK, you can't mix runtime libraries, so all your projects must use the same setting. Consistency is the key.

Another caveat: if you build with /MD, then your executable will look for some DLLs. Most likely your users won't have these DLLs, so you have to provide them with your distribution. I use /MT for all the projects in Box2D.sln so that I can distribute an executable file that doesn't require DLLs. The disadvantage is that the executable is larger and may take more memory.

Quote:
Anyhow, when I switch to /MT, I get various linker errors, and when I've removed them, I get this final and only message:

"box2d_d.lib(b2PairManager.obj) : error LNK2001: unresolved external symbol "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)"


Hmm, box2d_d.lib is a debug build, so you need to use a debug runtime library (/MTd).


Top
 Profile  
 
PostPosted: Sun Dec 30, 2007 5:59 pm 
Offline

Joined: Sun Dec 30, 2007 3:02 pm
Posts: 3
Unbelievable! I've spent more than five-six hours struggling with this -- and it now works!

I just included the Box2D project instead of linking to the .lib file. Thanks for the help :)


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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