[U-Boot] ref:fail to include stdio.h

Wolfgang Denk wd at denx.de
Thu Feb 26 09:14:53 CET 2009


Dear Paul,

In message <FE00509E242C6145AA57855D449BE2182A19D4 at server.Tectonica.local> you wrote:
> 
> The problem is: When I want to add any one of std header files anywhere
> on my architecture (pxa270), the compiler complains: stdio.h: No such
> file or directory.

U-Boot is not a standard application that runs  under  control  of  a
general  purpose  OS,  but  it's  a  boot loader that lives in a very
restricted, simple environment. As such, we cannot use the standard C
library (glibc).  Instead,  U-Boot  is  self-contained  and  includes
everything it needs, and nothing more.

<stdio.h> is a header file that is provided by glibc - it  cannot  be
used  with  U-Boot  as  U-Boot doesn't provide the context needed for
such a complex library like glibc.


I'm not sure why you would want to include  <stdio.h>  -  it  is  not
needed in U-Boot context. Please look around in the existing code how
things are set up in U-Boot. This is NOT like developing a user space
application  under Linux. It is even more restricted than programming
Linux kernel code (and  in  Linux  kernel  code  you  cannot  include
<stdio.h> either).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There are two kinds of people, those who do the work  and  those  who
take  the  credit.  Try  to  be  in  the  first  group; there is less
competition there.                                    - Indira Gandhi


More information about the U-Boot mailing list