kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel

Home Page:https://kmesh.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

complie error: /usr/include/bpf/bpf_helpers.h:74:2: error: '#' is not followed by a macro parameter

nlgwcy opened this issue · comments

  1. env:
    [root@localhost kmesh]# uname -r
    5.10.0-60.18.0.50.oe2203.x86_64
    [root@localhost kmesh]# yum info libbpf
    Last metadata expiration check: 22:58:20 ago on Fri 17 Nov 2023 11:45:50 AM CST.
    Installed Packages
    Name : libbpf
    Epoch : 2
    Version : 0.3
    Release : 1.h0.oe2203
    Architecture : x86_64
    Size : 239 k
    Source : libbpf-0.3-1.h0.oe2203.src.rpm
    Repository : @System
    From repo : everything
    Summary : Libbpf library
    URL : https://github.com/libbpf/libbpf
    License : LGPLv2 or BSD
    Description : A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its
    : supporting header files. The version of the package reflects the version of
    : ABI.

[root@localhost kmesh]#

  1. compile failed: complie error: /usr/include/bpf/bpf_helpers.h:74:2: error: '#' is not followed by a macro parameter
    [root@localhost kmesh]# ./build.sh
    ......
    In file included from ../../include/common.h:28:
    /usr/include/bpf/bpf_helpers.h:74:2: error: '#' is not followed by a macro parameter
    #if GNUC && !clang
    ^
    /usr/include/bpf/bpf_helpers.h:76:2: error: #else after #else
    #else
    ^
    /usr/include/bpf/bpf_helpers.h:80:2: error: #else after #else

  2. After the preceding error is temporarily avoided, the following error message is displayed when the compilation continues:
    /home/wcy/code/kmesh/oncn-mda/ebpf_src/sock_redirect.c:23:31: error: use of undeclared identifier 'NULL'
    struct sock_key *redir_key = NULL;
    It looks like some basic header files are not included. pls check it, thanks.