Opened 6 weeks ago

#74265 assigned defect

libcbor @0.14.0: build fails when libcjson and a previous libcbor are installed

Reported by: drkp (Dan Ports) Owned by: trodemaster (Blake Garner)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: libcbor

Description

Building or upgrading libcbor to 0.14.0 fails during the examples build:

/opt/local/include/cbor/common.h:177:1: error: unknown type name '_CBOR_NODISCARD'
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
make: *** [all] Error 2

This error comes from trying to include the currently installed libcbor's headers (not the ones currently being built). This occurs only when libcjson is also installed, because libcbor opportunistically links against it to build the examples, and picks up the -I${prefix}/include from its pkg-config file.

This is only used when building the examples, so adding -DWITH_EXAMPLES=OFF to configure.args fixes it for me. AFAICT, the examples aren't even installed so there should be no downside to adding this.

Change History (0)

Note: See TracTickets for help on using tickets.