Ubuntu 64bit 15.10 JSON loader problem

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
Voptiplex
Posts: 35
Joined: Thu Nov 14, 2013 1:07 pm

Ubuntu 64bit 15.10 JSON loader problem

Post by Voptiplex »

Hi Chris,

I am back with another problem .... ;-)

For my project I am using a Ubuntu box to double check my work done on a Mac.
I used to use a Ubuntu 32 bit installation, but now Qt 5.6 does not have precompiled 32 bit images any more.
So I changed my PC to be a Ubuntu 15.10 64 bit installation to be able to use Qt 5.6.

And now the trouble started with the b2d JSON C++ loader.
I got asserts in b2PolygonShape, stating that a polygon is degenerate. So I checked and the code fails on the first body and all the vertices values for x and y coordinates are either 0, 1 or -1.
So in b2dJson::jsonToFloat I checked the type of Json::Value and I do get a 3 which means real (e.g. floating point).

The code in jsonToFloat() is:
else
return value[name][index].asFloat();

Then I tried converting to other floating point formats, but always of the same 0, 1 and -1.


Just to double check, I used both GCC 5 and Clang on Ubuntu 64bit to compile the project, but with the same (wrong) result.


Code runs fine on:
- OSX (64bit)
- on iPad Mini 1 and iPad Air (32bit and 64bit unified)
- Ubuntu 32bit 15.10


Would you have any idea what could goes wrong with the Ubuntu 64bit build in b2dJson.cpp ?
Any hint where to start hunting for the problem ?
Could it be that the jsoncpp code is outdated ?

Thanks for your help again,
Thomas
Voptiplex
Posts: 35
Joined: Thu Nov 14, 2013 1:07 pm

Re: Ubuntu 64bit 15.10 JSON loader problem

Post by Voptiplex »

Hi Chris,

I have just taken the latest JsonCpp code and now all platforms including Ubuntu 64bit are working Ok.

So for me the issue is solved.

Best regards,
Thomas
Voptiplex
Posts: 35
Joined: Thu Nov 14, 2013 1:07 pm

Re: Ubuntu 64bit 15.10 JSON loader problem

Post by Voptiplex »

Just to explain a bit more:
I have taken the latest JsonCpp code from https://github.com/open-source-parsers/jsoncpp
and then followed the point:
'Generating amalgamated source and header'
in the Readme.md file.
Just copy the generated files into your project, works out of the box.

Cheers,
Thomas
Post Reply