Hi Drag,
You didn't says what the conflicts are between stdio.h and fileio.h, but it could be because gp32.h provides declarations, typedefs etc if stdio.h isn't included- for example, gp32.h might say something like
Code:
#ifndef FILE
#define FILE something
#endif
which provides a default definition of FILE so that the rest of gp32.h will not give missing symbol errors. It's like the programmer of gp32.h saying "Well, if the standard things aren't defined, then I'll define them so my code won't break". This works sometimes but, as you've seen, doesn't work other times.
In general, if you're going to include the standard headers like for example stdio.h, stdlib.h, and math.h, you should include them
first, before any other headers. And as you said, putting stdio.h first made the program compile.
A couple of other things: I don't know how replacing stdio.h with fileio.h makes everything work as pea said, but perhaps pea's programs use file I/O but not the other things that stdio provides, like sprintf.
Your comment about mirko's programs not including
stdlib.h but still using sprintf is a bit confusing - did you mean to say
stdio.h? In any case, I'm not familiar with mirko's sdk so I can't tell you how it works. You can guarantee, however, that somewhere in the #included files will be a prototype for sprintf.
And finally, putting -s on the linker just strips debugging symbols from the final program, which will indeed make it smaller. But it has nothing to do with including "extra stuff in stdlib", because the standard libraries are designed to make sure that only the needed parts are linked in. It won't be stdlib making your program bulky!