Trying to build Box2d as /MD

In order for others to play my game, i need to compile box2d as /MD for release. However, when i change /MTd to /MDd or /MD in the Box2D_v1.4.3\Box2D_v1.4.3\Box2D\Build\VC8 i get the error, that a file (MSVCP80D.dll) has not been found, so i went to google and downloaded the file and placed it in my win32 folder. However, im still getting the same error, so i was wondering if i have done something wrong? I'm using box2d along with SDL.
I chose /MT so that people can run the test-bed without needing the C runtime DLL. Does SDL require DLLs? You need to put the DLL in the same directory as your exe.
Yes, SDL require DLLs. I have them placed in the same folder, but it seems /MT and /MD libraries can't be mixed, which means i can't use SDL with box2d(with its current state). Is there any way to change box2d's runtime library?
Yes, you can change Box2D the project settings to suit your needs. I know that people have used Box2D successfully with SDL (e.g. Crayon Physics).
Ahhh, seemed i had to use RELEASE in order to make the missing DLL go away. However, in my game i seem to get a strange error about box2d.

Quote:
Warning 1 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library sdl physics
Error 2 error LNK2019: unresolved external symbol "public: struct b2Body * __thiscall b2World::CreateBody(struct b2BodyDef const *)" (?CreateBody@b2World@@QAEPAUb2Body@@PBUb2BodyDef@@@Z) referenced in function _SDL_main main.obj
Error 3 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\sdl physics\Release\sdl physics.exe

It seems you have conflicting code generation options in your various libraries.

Also, it seems that you are not linking in Box2D.
Hmm, this is my first game with box2d with SDL, so hopefully my next will go smoother 😛

This is my include files:
Code:
#include <iostream>
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
#include "SDL/SDL_rotozoom.h"
#include "SDL/SDL_gfxPrimitives.h"
#include "SDL/SDL_ttf.h"
#include "box2d/Box2D.h"         
#include <vector>
#include <math.h>
#include <string>

and i have linked to the following libraries:
SDL.lib SDLmain.lib SDL_image.lib SDL_mixer.lib box2d.lib box2d_d.lib sdlgfx.lib sdl_ttf.lib

edit: i made the warnings go away, but the error is still there.

Quote:
Error 1 error LNK2019: unresolved external symbol "public: struct b2Body * __thiscall b2World::CreateBody(struct b2BodyDef const *)" (?CreateBody@b2World@@QAEPAUb2Body@@PBUb2BodyDef@@@Z) referenced in function _SDL_main main.obj
Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\sdl physics\Release\sdl physics.exe



i also discovered that there is some library files at:
Box2D_v1.4.3\Box2D_v1.4.3\Box2D\Build\VC8\Box2D\Release

i tried moving them all to the folder at:
Microsoft Visual Studio 8\VC\lib
but there was no change. Is there anything i should do with those files? The error is still there 🙁.
Are you including the Box2D project in your solution? If so you can just make your application dependent on the Box2D project instead of linking the library explicitly.
I have added Box2d to my solution the following way now: right click solution->add->existing project, and then i changed my #include "box2d/Box2D.h" into #include "Box2D.h". However the error is still here, so i am almost surely not doing it the right way:

Quote:
Error 1 error LNK2019: unresolved external symbol "public: struct b2Body * __thiscall b2World::CreateBody(struct b2BodyDef const *)" (?CreateBody@b2World@@QAEPAUb2Body@@PBUb2BodyDef@@@Z) referenced in function _SDL_main main.obj
Error 2 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\sdl physics\Release\sdl physics.exe


Did you:
- set the project dependencies so you app depends on the Box2D project?
- remove the box2d.lib from you linker options?
- make sure all projects are using the same C lib option (/MT)?

Original thread: https://box2d.org/forum/viewtopic.php?t=156