Move the typedef to the top of the file, the effect is caused by the automatic prototype generation of the IDE. IMHO