C: Implicit declaration of function ‘read’ and ‘write’ 6


While working on an socket-based application, we received the following warnings from the compiler:

implicit declaration of function 'read'
implicit declaration of function 'write'

read and write functions are declared in unistd.h which we forgot to include in our code.

Adding the directive


#include <unistd.h>

to the source file that used read and/or write removed the warnings.

This post is also available in: Greek


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

6 thoughts on “C: Implicit declaration of function ‘read’ and ‘write’