serial.available OK with IDE and KO with C language

I always use the IDE, but just compile once verbose and you will see what includes to do it yourself without the IDE.