diff --git a/samples/net/udp/prj.conf b/samples/net/udp/prj.conf index 436b40c250fe..c870b5f3fc62 100644 --- a/samples/net/udp/prj.conf +++ b/samples/net/udp/prj.conf @@ -12,6 +12,7 @@ CONFIG_NETWORKING=y CONFIG_NET_NATIVE=y CONFIG_NET_IPV4=y CONFIG_NET_SOCKETS=y +CONFIG_POSIX_API=y CONFIG_NET_CONNECTION_MANAGER=y # Heap and stacks diff --git a/samples/net/udp/src/main.c b/samples/net/udp/src/main.c index e0ab907ef32f..f70ba5d11dab 100644 --- a/samples/net/udp/src/main.c +++ b/samples/net/udp/src/main.c @@ -13,6 +13,12 @@ #include #include +#if defined(CONFIG_POSIX_API) +#include +#include +#include +#endif + LOG_MODULE_REGISTER(udp_sample, CONFIG_UDP_SAMPLE_LOG_LEVEL); #define UDP_IP_HEADER_SIZE 28