If you are using version 5.2 or lower of the C compiler, undefine the fileno macro: #if defined(fileno) #undef fileno #endif