CodeConstruct / mctp

MCTP userspace tools
GNU General Public License v2.0
30 stars 17 forks source link

compile report errors #8

Closed yuan7520 closed 1 year ago

yuan7520 commented 1 year ago

errors report when I try to do ninja -C obj:

# meson --reconfigure obj
The Meson build system
Version: 0.53.2
Source dir: /home/zynq/mctp-main
Build dir: /home/zynq//mctp-main/obj
Build type: native build
Project name: mctp
Project version: v1.0
C compiler for the host machine: cc (gcc 9.4.0 "cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0")
C linker for the host machine: cc ld.bfd 2.34
Host machine cpu family: arm
Host machine cpu: armv7l
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Found CMake: /usr/bin/cmake (3.16.3)
Run-time dependency libsystemd found: NO (tried pkgconfig and cmake)
Has header "linux/mctp.h" : NO (cached)
Configuring config.h using configuration
Build targets in project: 3

Found ninja-1.10.0 at /usr/bin/ninja
root@xxx:/home/zynq/mctp-main# ninja -C obj
ninja: Entering directory `obj'
[1/2] Compiling C object 'mctp@exe/src_mctp.c.o'.
FAILED: mctp@exe/src_mctp.c.o 
cc -Imctp@exe -I. -I.. -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -g -Wno-unused-parameter -MD -MQ 'mctp@exe/src_mctp.c.o' -MF 'mctp@exe/src_mctp.c.o.d' -o 'mctp@exe/src_mctp.c.o' -c ../src/mctp.c
../src/mctp.c:109:3: error: 'IFLA_PROP_LIST' undeclared here (not in a function)
  109 |  [IFLA_PROP_LIST] = "IFLA_PROP_LIST",
      |   ^~~~~~~~~~~~~~
../src/mctp.c:109:3: error: array index in initializer not of integer type
../src/mctp.c:109:3: note: (near initialization for 'ifla_attrnames')
../src/mctp.c:110:3: error: 'IFLA_ALT_IFNAME' undeclared here (not in a function); did you mean 'IFLA_IFNAME'?
  110 |  [IFLA_ALT_IFNAME] = "IFLA_ALT_IFNAME",
      |   ^~~~~~~~~~~~~~~
      |   IFLA_IFNAME
../src/mctp.c:110:3: error: array index in initializer not of integer type
../src/mctp.c:110:3: note: (near initialization for 'ifla_attrnames')
../src/mctp.c:111:3: error: 'IFLA_PERM_ADDRESS' undeclared here (not in a function); did you mean 'IFLA_ADDRESS'?
  111 |  [IFLA_PERM_ADDRESS] = "IFLA_PERM_ADDRESS",
      |   ^~~~~~~~~~~~~~~~~
      |   IFLA_ADDRESS
../src/mctp.c:111:3: error: array index in initializer not of integer type
../src/mctp.c:111:3: note: (near initialization for 'ifla_attrnames')
../src/mctp.c:112:3: error: 'IFLA_PROTO_DOWN_REASON' undeclared here (not in a function); did you mean 'IFLA_PROTO_DOWN'?
  112 |  [IFLA_PROTO_DOWN_REASON] = "IFLA_PROTO_DOWN_REASON",
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   IFLA_PROTO_DOWN
../src/mctp.c:112:3: error: array index in initializer not of integer type
../src/mctp.c:112:3: note: (near initialization for 'ifla_attrnames')
../src/mctp.c:143:3: error: 'NDA_NH_ID' undeclared here (not in a function); did you mean 'RTA_NH_ID'?
  143 |  [NDA_NH_ID] = "NDA_NH_ID",
      |   ^~~~~~~~~
      |   RTA_NH_ID
../src/mctp.c:143:3: error: array index in initializer not of integer type
../src/mctp.c:143:3: note: (near initialization for 'nda_attrnames')
../src/mctp.c:144:3: error: 'NDA_FDB_EXT_ATTRS' undeclared here (not in a function)
  144 |  [NDA_FDB_EXT_ATTRS] = "NDA_FDB_EXT_ATTRS",
      |   ^~~~~~~~~~~~~~~~~
../src/mctp.c:144:3: error: array index in initializer not of integer type
../src/mctp.c:144:3: note: (near initialization for 'nda_attrnames')
ninja: build stopped: subcommand failed.

root@MEMBLAZE:/home/zynq//mctp-main# grep  IFLA_ALT_IFNAME src/*
src/mctp.c:     [IFLA_ALT_IFNAME] = "IFLA_ALT_IFNAME",

It seems some symbols are not defined? Thanks!

yuan7520 commented 1 year ago

sorry ,is an os issue.