Rename variable empty to emptyString in Value constructor to avoid shadowing of Value::empty().
GCC 4.8 produces the warning about this:
lib_json/json_value.cpp: In constructor ‘Json::Value::Value(Json::ValueType)’:
lib_json/json_value.cpp:346:27: warning: declaration of ‘empty’ shadows a member of 'this' [-Wshadow]
Otherwise failures like these one can happen during the configure phase
of other applications that use jsoncpp, like upmpdcli for instance:
checking jsoncpp/json/json.h usability... yes
checking jsoncpp/json/json.h presence... yes
checking for jsoncpp/json/json.h... yes
configure: error: libjsoncpp not found.
And this is the actual problem that you can see in config.log:
configure:5233: checking for jsoncpp/json/json.h
configure:5233: result: yes
configure:5259: /usr/bin/mipsel-linux-g++ -o conftest conftest.cpp
-lmicrohttpd -lmpdclient -lpthread -ljsoncpp >&5
In file included from /usr/include/jsoncpp/json/autolink.h:9:0,
from /usr/include/jsoncpp/json/json.h:9,
from conftest.cpp:26:
/usr/include/jsoncpp/json/config.h:155:9: error: 'int64_t' does not name
a type
typedef int64_t Int64;
^
/usr/include/jsoncpp/json/config.h:156:9: error: 'uint64_t' does not
name a type
typedef uint64_t UInt64;
^
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Recent commit 911e2b0fea ("By default use <prefix> relative paths when
installing") introduced relative install paths in CMake. But this
interacts badly with commit e6f1cffdd3 from a year ago: now, the paths in
`pkgconfig/jsoncpp.pc` are relative, which is incorrect.
Before 911e2b0fea (1.7.2 on Archlinux), this was correct:
$ head -4 /usr/lib/pkgconfig/jsoncpp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib
includedir=/usr/include
After 911e2b0fea (1.7.3 on Archlinux), this is now incorrect:
$ head -4 /usr/lib/pkgconfig/jsoncpp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=lib
includedir=include
This change causes hard-to-debug compilation errors for projects that
depend on jsoncpp, for instance:
CXXLD libring.la
/tmp/ring-daemon/src/ring-daemon/src/../libtool: line 7486: cd: lib: No such file or directory
libtool: error: cannot determine absolute directory name of 'lib'
make[3]: *** [Makefile:679: libring.la] Error 1
This is because jsoncpp contributes `-Llib -ljsoncpp` to the LDFLAGS, via
the pkg-config machinery. Notice the relative path in `-Llib`.
To fix this, simply revert commit e6f1cffdd3 ("Fix custom includedir &
libdir substitution in pkg-config"). The change in 911e2b0fea should have
the same effect.
See #279, #470 for references.