As can be seen from the error message, you have overloads for the read function. The one that you used before including unistd.h is not the same as what unistd.h declares. An overloaded function cannot be implicitly converted into a function pointer, because the compiler cannot know which read function you intended to use.

You can explicitly cast the identifier to a function pointer of correct type to resolve the ambiguity.

Email codedump link for C++ strange compiler error if &lt;unistd.h&gt; is included