stdio.h not found on Solaris 11

Hi friends,
I hope u r doing well. I have just installed Solaris 11, and it seems that solaris 11 doesn't come with all the packages, one has to do everything manually. I download gcc from sunfreeware.com and installed it. After setting up the path variable, I tried to compile the hello world program in c, and here I face this error.

 
 
gcc Hello.c -o Hello
Hello.c:1:20: stdio.h: No such file or directory

I searched for stdio.h by

find / -name stdio.h -print

and found stdio.h under /usr/include/ast/stdio.h

But when I opended this file, it reads as

 
vi /usr/include/ast/stdio.h
/*
 * BEGIN OpenSolaris section
 *   This is an unstable interface; changes may be made
 *   without notice.
 * END OpenSolaris section
 */
/***********************************************************************
*                                                                      *
*               This software is part of the ast package               *
*          Copyright (c) 1985-2011 AT&T Intellectual Property          *
*                      and is licensed under the                       *
*                  Common Public License, Version 1.0                  *
*                    by AT&T Intellectual Property                     *
*                                                                      *
*                A copy of the License is available at                 *
*            Common Public License Version 1.0 | Open Source Initiative             *
*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
*                                                                      *
*              Information and Software Systems Research               *
*                            AT&T Research                             *
*                           Florham Park NJ                            *
*                                                                      *
*                 Glenn Fowler <gsf@research.att.com>                  *
*                  David Korn <dgk@research.att.com>                   *
*                   Phong Vo <kpv@research.att.com>                    *
*                                                                      *
***********************************************************************/
#include <ast_stdio.h>
 

I have no idea what to do. Could you please help me set up gcc on Solaris 11??

Thanks in advance!

Last time I checked, sunfreeware had no gcc package suitable for Solaris 11. I would suggest to remove the gcc package you installed from there and use the Solaris 11 packaging command instead:

 $ sudo pkg install gcc-3

This will install gcc and all required dependencies automatically.

Looks like an incomplete install of Solaris 11. What exactly was installed?

It's not uncommon for stdio.h to just include a different file on its own. gentoo for instance does a bit of magic with paths to have slightly different include files for different architectures(so that some constants change appropriately). What's weird is that your compiler couldn't find it...

/usr/lib/stdio.h is not part of some default Solaris installations.
It can be installed with this command:

# pkg install system/header