compiler error that depends upon the location of a typedef...

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