Examples from Radiohead error with unistd.h

I have installed the RadioHead Library, and am attempting to compile the example file nrf905_server for the Arduino Uno.

I get the error:
.pioenvs\arduino_uno\RadioHead_ID124\RHutil\HardwareSerial.cpp:10:20: fatal error: unistd.h: No such file or directory

This file is designed to emulate the hardware serial port of the Arduino on a Unix platform, hence it is looking for and fails to find a non-existant posix header file. As I am targetting a real Arduino, I should never need to try compiling this compatibility file.

If I compile the same example under the Arduino IDE with verbose output, I see that no attempt is ever made to compile this file, so the error is avoided.

Is it expected that PlatformIO should attempt to compile this file even though it is not needed? Also, is there some way to prevent this?

Hi @DavidPowell!
Thanks for the hint. I’ve just fixed library config, so you can update the library.

Thanks @valeros, that fixed the problem. However, because the library version was unchanged, platformio update did nothing. However manually uninstalling, deleting the .pioenvs folder and reinstalling got it working.

Please update library RadioHead:
In file included from /home/dano/.platformio/lib/RadioHead_ID124/RHCRC.h:12:0,from /home/dano/.platformio/lib/RadioHead_ID124/RHCRC.cpp:43:/home/dano/.platformio/lib/RadioHead_ID124/RadioHead.h:669:29: fatal error: RHutil/atomic.h: No such file or directory#include <RHutil/atomic.h>^compilation terminated.
library is old and folder RHutil is missing, I tried to compile program with #include “RH_ASK.h” for arduino Due.

@Daniel_Kutka Thanks, updated! Don’t forget that you can also edit library manifest and update verison.

P.S: You need PlatformIO 3.0 to build this library. It has not been released yet. However, you can try development version Redirecting... . PlatformIO 3.0 is going to be released next week.

@Daniel_Kutka , @DavidPowell PlatformIO 3.0 is out! Please upgrade!