Page 1 of 1

Error LNK 2019 b2dJson::b2dJson(bool)

Posted: Thu Feb 19, 2015 7:02 pm
by huginn18
Hello everyone,
I was trying to use R.U.B.E. and b2djson but... when I try to compile project in Visual Studio 2013, I get this error

Code: Select all

Error   6   error LNK2019: unresolved external symbol "public: __thiscall b2dJson::b2dJson(bool)" (??0b2dJson@@QAE@_N@Z) referenced in function "public: __thiscall MapLoader::MapLoader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0MapLoader@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Please save my sanity and help me :!:

Re: Error LNK 2019 b2dJson::b2dJson(bool)

Posted: Thu Feb 19, 2015 9:12 pm
by iforce2d
It looks like you need to add b2dJson.cpp to your project.

Re: Error LNK 2019 b2dJson::b2dJson(bool)

Posted: Thu Feb 19, 2015 9:28 pm
by huginn18
When I add loader files directly (before with VC++ directories) to the project I must add freeglut. This is normal thing or maybe I "installed" something wrong?

Re: Error LNK 2019 b2dJson::b2dJson(bool)

Posted: Fri Feb 20, 2015 11:52 am
by iforce2d
The header for b2dJsonImage_OpenGL.h uses freeglut because Box2D comes with freeglut and most people will commonly be using the Box2D source as is (at least when they first start out).

But there is no reason you need to use the b2dJsonImage_OpenGL class at all. It's just an example, to show one way you can extend the b2dJsonImage class for a specific rendering method. So if you use DirectX then you would need to make a b2dJsonImage_DX or something to draw your images instead.