Share

json-cpp

Tracker: Bugs

5 won't build with GCC 4.3.1 - ID: 2020365
Last Update: Comment added ( nobody )

GCC 4.3.1's c++ header files avoid including as many C header files as they
used to... which means that in the json-cpp code base, there are now some
missing declarations of C string functions.

Errors when building with GCC 4.3.1:

src/lib_json/json_reader.cpp: In member function 'bool
Json::Reader::decodeDouble(Json::Reader::Token&)':
src/lib_json/json_reader.cpp:522: error: 'memcpy' was not declared in this
scope


src/lib_json/json_value.cpp: In member function 'virtual char*
Json::DefaultValueAllocator::duplicateStringValue(const char*, unsigned
int)':
src/lib_json/json_value.cpp:83: error: 'strlen' was not declared in this
scope
src/lib_json/json_value.cpp:85: error: 'memcpy' was not declared in this
scope
src/lib_json/json_value.cpp: In member function 'bool
Json::Value::CZString::operator<(const Json::Value::CZString&) const':
src/lib_json/json_value.cpp:220: error: 'strcmp' was not declared in this
scope
src/lib_json/json_value.cpp: In member function 'bool
Json::Value::CZString::operator==(const Json::Value::CZString&) const':
src/lib_json/json_value.cpp:228: error: 'strcmp' was not declared in this
scope
src/lib_json/json_value.cpp: In member function 'bool
Json::Value::operator<(const Json::Value&) const':
src/lib_json/json_value.cpp:570: error: 'strcmp' was not declared in this
scope
src/lib_json/json_value.cpp: In member function 'bool
Json::Value::operator==(const Json::Value&) const':
src/lib_json/json_value.cpp:636: error: 'strcmp' was not declared in this
scope
src/lib_json/json_value.cpp: In member function 'void
Json::Path::makePath(const std::string&, const std::vector<const
Json::PathArgument*, std::allocator<const Json::PathArgument*> >&)':
src/lib_json/json_value.cpp:1578: error: 'strchr' was not declared in this
scope


Nobody/Anonymous ( nobody ) - 2008-07-17 08:07

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2009-05-04 14:59
Sender: nobody

you need to #include <string.h> at the top of
src/lib_json/json_{reader,value}.cpp

fixed it for me. please update!


Log in to comment.

Attached File ( 1 )

Filename Description Download
include_string.patch patch to fix the issue by including string.h. Download

Change ( 1 )

Field Old Value Date By
File Added 285024: include_string.patch 2008-07-17 08:07 nobody