Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to build on FreeBSD src/rt.c:679:25: error: field has incomplete type 'struct nlmsghdr' #73

Open
ghost opened this issue Oct 5, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 5, 2021

Hi,

EDIT:
Latest commit broke it, e1746bb

I used the previous one and it worked fine to build.


Trying to build ndpdd on FreeBSD, I'm using make, have tried with both clang and gcc:
lrwxr-xr-x 1 root wheel 19 Oct 5 14:09 /usr/bin/gcc -> /usr/local/bin/gcc9

I get this errors, any ideas? Thanks!

Cloning into 'ndppd'...
remote: Enumerating objects: 1258, done.
remote: Counting objects: 100% (100/100), done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 1258 (delta 66), reused 61 (delta 32), pack-reused 1158
Receiving objects: 100% (1258/1258), 356.62 KiB | 2.48 MiB/s, done.
Resolving deltas: 100% (939/939), done.
root@test:~ # cd ndppd/
root@test:~/ndppd # git checkout 1.0-devel
Branch '1.0-devel' set up to track remote branch '1.0-devel' from 'origin'.
Switched to a new branch '1.0-devel'

 gmake all
cc -c  -Os -Werror -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -o src/rt.o src/rt.c
src/rt.c:679:25: error: field has incomplete type 'struct nlmsghdr'
        struct nlmsghdr hdr;
                        ^
src/rt.c:679:16: note: forward declaration of 'struct nlmsghdr'
        struct nlmsghdr hdr;
               ^
src/rt.c:680:22: error: field has incomplete type 'struct ndmsg'
        struct ndmsg msg;
                     ^
src/rt.c:680:16: note: forward declaration of 'struct ndmsg'
        struct ndmsg msg;
               ^
src/rt.c:681:55: error: use of undeclared identifier 'NLMSG_ALIGNTO'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
                                                      ^
src/rt.c:681:23: error: field has incomplete type 'struct rtattr'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
                      ^
src/rt.c:681:16: note: forward declaration of 'struct rtattr'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
               ^
src/rt.c:684:27: error: use of undeclared identifier 'RTM_NEWNEIGH'
        .hdr.nlmsg_type = RTM_NEWNEIGH,
                          ^
src/rt.c:685:28: error: use of undeclared identifier 'NLM_F_REQUEST'
        .hdr.nlmsg_flags = NLM_F_REQUEST,
                           ^
src/rt.c:688:26: error: use of undeclared identifier 'NUD_PERMANENT'
        .msg.ndm_state = NUD_PERMANENT,
                         ^
src/rt.c:689:26: error: use of undeclared identifier 'NTF_PROXY'
        .msg.ndm_flags = NTF_PROXY,
                         ^
src/rt.c:691:30: error: use of undeclared identifier 'NDA_DST'
        .dst_attr.rta_type = NDA_DST,
                             ^
src/rt.c:692:29: error: implicit declaration of function 'RTA_LENGTH' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        .dst_attr.rta_len = RTA_LENGTH(sizeof(req.dst)),
                            ^
src/rt.c:696:46: error: use of undeclared identifier 'AF_NETLINK'
    struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
                                             ^
src/rt.c:696:24: error: variable has incomplete type 'struct sockaddr_nl'
    struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
                       ^
src/rt.c:696:12: note: forward declaration of 'struct sockaddr_nl'
    struct sockaddr_nl addr = { .nl_family = AF_NETLINK };
           ^
src/rt.c:704:25: error: field has incomplete type 'struct nlmsghdr'
        struct nlmsghdr hdr;
                        ^
src/rt.c:704:16: note: forward declaration of 'struct nlmsghdr'
        struct nlmsghdr hdr;
               ^
src/rt.c:705:22: error: field has incomplete type 'struct ndmsg'
        struct ndmsg msg;
                     ^
src/rt.c:705:16: note: forward declaration of 'struct ndmsg'
        struct ndmsg msg;
               ^
src/rt.c:706:55: error: use of undeclared identifier 'NLMSG_ALIGNTO'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
                                                      ^
src/rt.c:706:23: error: field has incomplete type 'struct rtattr'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
                      ^
src/rt.c:706:16: note: forward declaration of 'struct rtattr'
        struct rtattr dst_attr __attribute__((aligned(NLMSG_ALIGNTO)));
               ^
src/rt.c:709:27: error: use of undeclared identifier 'RTM_DELNEIGH'
        .hdr.nlmsg_type = RTM_DELNEIGH,
                          ^
src/rt.c:710:28: error: use of undeclared identifier 'NLM_F_REQUEST'
        .hdr.nlmsg_flags = NLM_F_REQUEST,
                           ^
src/rt.c:713:26: error: use of undeclared identifier 'NUD_PERMANENT'
        .msg.ndm_state = NUD_PERMANENT,
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [Makefile:35: src/rt.o] Error 1```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants