Opened 18 months ago

Last modified 18 months ago

#67462 assigned defect

libplist @2.3.0 build failure: plistutil.c:119:36: error: use of undeclared identifier 'PLIST_FORMAT_BINARY'

Reported by: dbl001 (dbl) Owned by: JacksonIsaac (Jackson Isaac)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: i0ntempest
Port: libplist

Description

This error was on MacOS Catalina

:info:build /usr/bin/clang -DHAVE_CONFIG_H -I. -I..   -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Wno-strict-aliasing -fvisibility=hidden -I../include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -MT plistutil.o -MD -MP -MF .deps/plistutil.Tpo -c -o plistutil.o plistutil.c
:info:build plistutil.c:119:36: error: use of undeclared identifier 'PLIST_FORMAT_BINARY'
:info:build                 options->out_fmt = PLIST_FORMAT_BINARY;
:info:build                                    ^
:info:build plistutil.c:121:36: error: use of undeclared identifier 'PLIST_FORMAT_XML'
:info:build                 options->out_fmt = PLIST_FORMAT_XML;
:info:build                                    ^
:info:build plistutil.c:123:36: error: use of undeclared identifier 'PLIST_FORMAT_JSON'
:info:build                 options->out_fmt = PLIST_FORMAT_JSON;
:info:build                                    ^
:info:build plistutil.c:125:36: error: use of undeclared identifier 'PLIST_FORMAT_OSTEP'
:info:build                 options->out_fmt = PLIST_FORMAT_OSTEP;
:info:build                                    ^
:info:build plistutil.c:150:32: error: use of undeclared identifier 'PLIST_FORMAT_PRINT'
:info:build             options->out_fmt = PLIST_FORMAT_PRINT;
:info:build                                ^
:info:build plistutil.c:154:40: error: use of undeclared identifier 'PLIST_FORMAT_PLUTIL'
:info:build                     options->out_fmt = PLIST_FORMAT_PLUTIL;
:info:build                                        ^
:info:build plistutil.c:156:40: error: use of undeclared identifier 'PLIST_FORMAT_LIMD'
:info:build                     options->out_fmt = PLIST_FORMAT_LIMD;
:info:build                                        ^
:info:build plistutil.c:190:21: error: use of undeclared identifier 'PLIST_ERR_UNKNOWN'
:info:build     int input_res = PLIST_ERR_UNKNOWN;
:info:build                     ^
:info:build plistutil.c:191:22: error: use of undeclared identifier 'PLIST_ERR_UNKNOWN'
:info:build     int output_res = PLIST_ERR_UNKNOWN;
:info:build                      ^
:info:build plistutil.c:210:9: error: implicit declaration of function 'plist_set_debug' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build         plist_set_debug(1);
:info:build         ^
:info:build plistutil.c:288:30: error: use of undeclared identifier 'PLIST_ERR_SUCCESS'
:info:build             if (input_res == PLIST_ERR_SUCCESS) {
:info:build                              ^
:info:build plistutil.c:290:21: error: implicit declaration of function 'plist_sort' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build                     plist_sort(root_node);
:info:build                     ^
:info:build plistutil.c:290:21: note: did you mean 'plist_copy'?
:info:build /opt/local/include/plist/plist.h:220:13: note: 'plist_copy' declared here
:info:build     plist_t plist_copy(plist_t node);
:info:build             ^
:info:build plistutil.c:298:30: error: use of undeclared identifier 'PLIST_ERR_SUCCESS'
:info:build             if (input_res == PLIST_ERR_SUCCESS) {
:info:build                              ^
:info:build plistutil.c:300:21: error: implicit declaration of function 'plist_sort' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
:info:build                     plist_sort(root_node);
:info:build                     ^
:info:build plistutil.c:308:76: error: too many arguments to function call, expected 3, have 4
:info:build         input_res = plist_from_memory(plist_entire, read_size, &root_node, NULL);
:info:build                     ~~~~~~~~~~~~~~~~~                                      ^~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_null.h:30:15: note: expanded from macro 'NULL'
:info:build #define NULL  __DARWIN_NULL
:info:build               ^~~~~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:52:23: note: expanded from macro '__DARWIN_NULL'
:info:build #define __DARWIN_NULL ((void *)0)
:info:build                       ^~~~~~~~~~~
:info:build /opt/local/include/plist/plist.h:699:5: note: 'plist_from_memory' declared here
:info:build     void plist_from_memory(const char *plist_data, uint32_t length, plist_t * plist);
:info:build     ^

...

Attachments (1)

main.log (74.0 KB) - added by dbl001 (dbl) 18 months ago.

Download all attachments as: .zip

Change History (5)

Changed 18 months ago by dbl001 (dbl)

Attachment: main.log added

comment:1 Changed 18 months ago by jmroot (Joshua Root)

Cc: i0ntempest added
Owner: set to JacksonIsaac
Status: newassigned
Summary: :info:build plistutil.c:119:36: error: use of undeclared identifier 'PLIST_FORMAT_BINARY'libplist @2.3.0 build failure: plistutil.c:119:36: error: use of undeclared identifier 'PLIST_FORMAT_BINARY'

comment:2 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

The order of the include flags is wrong:

-I. -I..   -I/opt/local/include [...] -I../include

So if there is any file in ../include that also exists in /opt/local/include, the one in /opt/local/include will be used, and that will probably be the wrong file. It might be an unrelated file, or it could be a file from a previous version of libplist.

Try with trace mode to hide files from ports that are not declared as dependencies:

sudo port clean libplist
sudo port -st install libplist

If that fixes it, the solution is for the order of the flags to be corrected. If that is not possible, another solution is to change -I/opt/local/include to -isystem/opt/local/include:

configure.cppflags-replace -I${prefix}/include -isystem${prefix}/include

-isystem paths are searched after -I paths. Or to remove -I${prefix}/include entirely since libplist doesn't have any library dependencies:

configure.cppflags-delete -I${prefix}/include

comment:3 Changed 18 months ago by i0ntempest

Most likely the headers from the previous version of libplist is picked up instead of the new headers in the tarball, as Ryan said. Try deactiviting the old version first.

comment:4 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

...or use trace mode which will hide them.

Note: See TracTickets for help on using tickets.