Compilation error when adding lwm2m client on CHIP/matter sample

Hi,

We are trying to add lwm2m (client) into light bulb sample (matter).

It results a redefinition of gethosname : CONFIG_LWM2M defines CONFIG_NET_SOCKETS_POSIX_NAMES and it seems that CHIP is using BSP ones.

Do you have an idea to solve that problem? 

In file included from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/pthread.h:13,
                 from C:/Users/Romain/Soft/ncs/zephyr/lib/posix/pthread.c:12:
C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/unistd.h:38:19: error: redefinition of 'gethostname'
   38 | static inline int gethostname(char *buf, size_t len)
      |                   ^~~~~~~~~~~
In file included from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/unistd.h:13,
                 from C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/posix/pthread.h:13,
                 from C:/Users/Romain/Soft/ncs/zephyr/lib/posix/pthread.c:12:
C:/Users/Romain/Soft/ncs/zephyr/include/zephyr/net/socket.h:809:19: note: previous definition of 'gethostname' was here
  809 | static inline int gethostname(char *buf, size_t len)

How to reproduce : use the matter sample (light bulb) and add CONFIG_LWM2M.

Thanks for your help

Parents Reply Children
No Data
Related