Skip to content

MacOS Monteray Xcode 13 build failure incomplete type 'struct nfsstats' #150

@MarekR22

Description

@MarekR22

Apparently system library header files has been changed for latest Xcode hiding definition of struct nfsstats.
As a result sigar fails to compile.

Xcode Version 13.2.1 (13C100)
MacOS Monteray 12.1 (21C52)

Steps I used:

git clone https://github.com/hyperic/sigar.git
cd sigar
mkdir build
cd build
cmake -G Xcode ..
cmake --build . -j 4

Outcome:

/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3233:24: error: invalid application of 'sizeof' to an incomplete type 'struct nfsstats'
    size_t len = sizeof(*stats);
                       ^~~~~~~~
/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3231:32: note: forward declaration of 'struct nfsstats'
static int get_nfsstats(struct nfsstats *stats)
                               ^
/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3303:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3303:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^
/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3329:21: error: variable has incomplete type 'struct nfsstats'
    struct nfsstats stats;
                    ^
/Users/marekR22/Downloads/sigar/src/os/darwin/darwin_sigar.c:3329:12: note: forward declaration of 'struct nfsstats'
    struct nfsstats stats;
           ^

I'm still trying to find proper header file to include, but no luck so far.
I will provide pull request when I find solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions