GP32 Devkitpro Error With Including Stdio.h


0-bake

Active Member
Joined
Dec 15, 2003
Messages
538
hi,

i just installed the new devkitpro using the devkitPro Updater 1.2.1
i can compile some of the examples in gp32\libmirko as long as the don't include the <stdio.h>.

i get following errors:

Code:
> "make" 
sprite.c
In file included from c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:5:
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:176: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:196: error: syntax error before 'fread'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:196: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:197: error: syntax error before 'fwrite'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:197: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:236: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:237: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:241: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:242: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:308: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:309: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:324: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:325: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:333: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:334: error: syntax error before 'size_t'
make[1]: *** [sprite.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2

but i can just remove the included stdio.h, then i just get warnings:

Code:
> "make" 
sprite.c
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c: In function 'main':
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:53: warning: implicit declaration of function 'sprintf'
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:53: warning: incompatible implicit declaration of built-in function 'sprintf'
linking binary
built ... sprite.bin

b2fxeC v0.6a-pre2 - (c) 2002-4 Jouni 'Mr.Spiv' Korhonen

Crunching (0/152552)
Crunched 76.8% - total 35372 bytes
built ... sprite.fxe
rm /c/devkitPro/examples/gp32/libmirko/sprite/sprite.bin

> Process Exit Code: 0

whats the actual problem here?
i recognized this, because i get many warnings in my project, such as "implicit declaration of function 'rand'" and so on.
 
0-bake posted on Dec 9 2005 at 03:42 PM said:
hi at

i just installed the new devkitpro using the devkitPro Updater 1.2.1
i can compile some of the examples in gp32\libmirko as long as the don't include the <stdio.h>.

i get following errors:

Code:
> "make" 
sprite.c
In file included from c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:5:
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:176: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:196: error: syntax error before 'fread'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:196: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:197: error: syntax error before 'fwrite'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:197: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:236: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:237: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:241: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:242: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:308: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:309: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:324: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:325: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:333: error: syntax error before 'size_t'
c:\devkitpro\devkitarm\bin\../lib/gcc/arm-elf/4.0.2/../../../../arm-elf/include/stdio.h:334: error: syntax error before 'size_t'
make[1]: *** [sprite.o] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2

but i can just remove the included stdio.h, then i just get warnings:

Code:
> "make" 
sprite.c
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c: In function 'main':
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:53: warning: implicit declaration of function 'sprintf'
c:/devkitPro/examples/gp32/libmirko/sprite/source/sprite.c:53: warning: incompatible implicit declaration of built-in function 'sprintf'
linking binary
built ... sprite.bin

b2fxeC v0.6a-pre2 - (c) 2002-4 Jouni 'Mr.Spiv' Korhonen

Crunching (0/152552)
Crunched 76.8% - total 35372 bytes
built ... sprite.fxe
rm /c/devkitPro/examples/gp32/libmirko/sprite/sprite.bin

> Process Exit Code: 0

whats the actual problem here?
i recognized this, because i get many warnings in my project, such as "implicit declaration of function 'rand'" and so on.


Dont include <stdio.h> !!!!!
They will conflict with the types in fileio.h
implicit warnings are not "so" bad... They only mean, that there is no prototype found, for your calling function, but it is working 100%.

If you want to remove the implicite warnings, add the prototype of the function, missing, add it before the first function using sprintf.
int sprintf(char *str, const char *format, ...);

sorry no better way for a short solution...
 
Last edited by a moderator:
mr.mirko posted on Dec 9 2005 at 04:34 PM said:
Dont include <stdio.h> !!!!!
They will conflict with the types in fileio.h
implicit warnings are not "so" bad... They only mean, that there is no prototype found, for your calling function, but it is working 100%.

If you want to remove the implicite warnings, add the prototype of the function, missing, add it before the first function using sprintf.
int sprintf(char *str, const char *format, ...);

sorry no better way for a short solution...

ok, thanks, i didn't knew that.

but btw, this was just an unedited example from your libmirko ;)

found in \devkitpro\examples\gp32\libmirko\sprite
 
Last edited by a moderator:
Why make fileio.h so that it conflicts with stdio.h? Why not fix fileio.h?

(Answer: Its work, and heres the source ;)

jeff
 
Back
Top