Topic: Redefinition error in Zephyr platform

Hi,
I am working with nRF5340 ZEPHYR RTOS. When I configure the wolfssl lib to build with my application I am getting the below error

/opt/nordic/ncs/v2.3.0/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 /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/posix/unistd.h:13:
/opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/net/socket.h:856:19: note: previous definition of 'gethostname' with type 'int(char *, size_t)' {aka 'int(char *, unsigned int)'}
  856 | static inline int gethostname(char *buf, size_t len)

Below are some details about our setup

Target board: nRF5340
NRF SDK version: v2.3.0

Below are the macro flags enabled in out prj.conf file

# wolfssl
CONFIG_WOLFSSL=y
CONFIG_WOLFSSL_LIBRARY=n
CONFIG_WOLFSSL_BUILTIN=y
CONFIG_WOLFSSL_TLS_VERSION_1_2=y

CONFIG_POSIX_API=y
CONFIG_POSIX_CLOCK=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_WOLFSSL_DEBUG=y

Have tried v2.2.0 and v2.3.0 and I see the same result on both SDKs

Please help me with this as this is a blocker for me. Thank you in advance.

Share

Re: Redefinition error in Zephyr platform

Hello Amjal,

Sorry to hear about your trouble with the Zephyr port. The port was last tested on Zephyr 2.7 with Zephyr SDK 0.13.1.

If this is a project blocker, I suggest using our Support system by emailing support@wolfssl.com

Thanks,
Eric - wolfSSL Support