Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60326 closed defect (fixed)

jsoncpp @1.9.2: error: inline declaration of 'as<bool>' follows non-inline definition

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: yosemite Cc:
Port: jsoncpp

Description

jsoncpp does not build, at least not on Yosemite:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_jsoncpp/jsoncpp/work/jsoncpp-1.9.2/src/lib_json/../../include/json/value.h:680:32: error: inline declaration of 'as<bool>' follows non-inline definition
template <> inline bool Value::as<bool>() const { return asBool(); }
                               ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_jsoncpp/jsoncpp/work/jsoncpp-1.9.2/src/lib_json/../../include/json/value.h:680:32: note: previous definition is here

(This is just the first of many similar errors.)

Change History (8)

comment:1 Changed 4 years ago by michaelld (Michael Dickens)

hmmm ... that's really a strange error .... let me load up 10.10 & see what happens on an actual computer ...

comment:2 Changed 4 years ago by michaelld (Michael Dickens)

yup ... that's an issue ... wondering if it's old Clang pretending to provide c++11 while not actually ... will test on 10.9 and 10.11 as well ...

comment:3 Changed 4 years ago by michaelld (Michael Dickens)

Looks like it is indeed Clang pretending to provide C++11 while not actually ... or something like that. Pretty simple to fix, just like I did Volk over the weekend.

comment:4 Changed 4 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In 188538e7e336b65dff122beb1ac273348926e54e/macports-ports (master):

jsoncpp: block Clang < 900

Rev-bump just in case ...

Closes: #60326

comment:5 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Can you elaborate? We had long settled on ~500 as the Apple clang version that supports C++11 and we build many C++11-requiring ports successfully with that.

comment:6 Changed 4 years ago by michaelld (Michael Dickens)

I'll admit I didn't to much "critical thinking" here; I just noted which versions of Apple Clang failed to build the port, then assumed it was a C++11 thing since more recent Clang succeeded. If I had to guess, it would be C++11 GNU extensions not being supported; just a guess though.

comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I'm now having trouble building raceintospace (which depends on jsoncpp) on 10.9, and it's giving an error on these same lines of json/value.h. raceintospace already specifies that it requires compiler.cxx_standard 2011 but it does not additionally blacklist clang < 900 because that has never before been necessary for C++11 support and I find it hard to believe that it is required here.

I think the real problem is that jsoncpp was failing to set -std=c++11 everywhere it needed to. I think forcing the use of clang 900 or later gave you a compiler that defaults to C++11 mode, avoiding the problem.

As far as I can tell this problem has been fixed in jsoncpp 1.9.3 so I'll suggest reverting your change in the PR that I'll submit shortly. I'm not sure what upstream commit fixed it but it might be this one.

comment:8 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

In 88eed39ee0195509e3ce88dacf1e34fd286d06b3/macports-ports (master):

jsoncpp: Update to 1.9.3

The ccache workaround is needed for the stable version too.

The compiler blacklist is not needed anymore.
See: #60326

Note: See TracTickets for help on using tickets.