Error LNK 2019 b2dJson::b2dJson(bool)

General discussion about the R.U.B.E editor
Post Reply
huginn18
Posts: 4
Joined: Thu Feb 19, 2015 6:37 pm

Error LNK 2019 b2dJson::b2dJson(bool)

Post 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 :!:
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

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

Post by iforce2d »

It looks like you need to add b2dJson.cpp to your project.
huginn18
Posts: 4
Joined: Thu Feb 19, 2015 6:37 pm

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

Post 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?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

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

Post 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.
Post Reply