Search code examples
c++cunixarduinocoap

Unable to use microcoap library due to this error. Any fixes?


I am unable to use microcoap library (https://github.com/1248/microcoap) in Arduino IDE. When I try to compile it produces following error

main-posix.c:1:24: fatal error: sys/socket.h: No such file or directory
#include <sys/socket.h>
                      ^

This question has already been answered in (Cant use Micro-Coap library for arduino) but the answer doesn't make sense.


Solution

  • Delete that main-posix.c because this is necessary for linux, not Arduino. It will definitely work.