Siniyas
Siniyas

Reputation: 471

Cant use Micro-Coap library for arduino

I am trying to get the micro-coap librarby (https://github.com/1248/microcoap) to work on my arduino. When I try to compile it in the Arduino IDE, it reports that <sys/socket.h> dependency in main-posix.c can not be found.

Searches for the problem were not helpful, except for some general C++ answer that was hinting that there is no sys/socket.h on Windows. But this should not have anything to do with Arduino right?

I looked at the ethernet library for arduino and there is a socket.h but it is not in a sys directory.

Hope you can help

Upvotes: 0

Views: 775

Answers (2)

Siniyas
Siniyas

Reputation: 471

Someone suggested simply taking the file out of the arduino path / deleting it and that worked. As Stefan posted in his answer, it is used to build the library on unix/linux and has no relevance for arduino.

Upvotes: 2

Stefan Bossbaly
Stefan Bossbaly

Reputation: 6804

It seems that the main-posix.c source file is meant to be compile for a UNIX/LINUX based operating system. If you want to use Windows to compile main-posix.c, you can use projects like Cygwin. Arduino does not have <sys/socket.h> dependency needed to compile main-posix.c. Instead open microcoap.ino in the Arduino IDE and compile and flash it to the hardware.

Upvotes: 2

Related Questions