stdio.h not found on Solaris 11 | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

stdio.h not found on Solaris 11

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-18-2012
gabam gabam is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 15 August 2013, 3:47 PM EDT
Posts: 117
Thanks: 31
Thanked 2 Times in 2 Posts
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.

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

I searched for stdio.h by


Code:
find / -name stdio.h -print

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

But when I opended this file, it reads as


Code:


Code:
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!
Sponsored Links
    #2  
Old 03-18-2012
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Last Activity: 23 October 2014, 12:33 PM EDT
Location: Paris
Posts: 4,431
Thanks: 16
Thanked 473 Times in 427 Posts
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:

Code:
 $ sudo pkg install gcc-3

This will install gcc and all required dependencies automatically.
Sponsored Links
    #3  
Old 03-19-2012
achenle achenle is offline
Registered User
 
Join Date: Jun 2009
Last Activity: 23 October 2014, 9:45 AM EDT
Posts: 718
Thanks: 1
Thanked 102 Times in 98 Posts
Looks like an incomplete install of Solaris 11. What exactly was installed?
    #4  
Old 03-19-2012
Corona688 Corona688 is online now Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 23 October 2014, 2:31 PM EDT
Location: Saskatchewan
Posts: 19,668
Thanks: 819
Thanked 3,346 Times in 3,134 Posts
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...
Sponsored Links
    #5  
Old 03-19-2012
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Last Activity: 23 October 2014, 12:33 PM EDT
Location: Paris
Posts: 4,431
Thanks: 16
Thanked 473 Times in 427 Posts
Quote:
Originally Posted by achenle View Post
Looks like an incomplete install of Solaris 11.
/usr/lib/stdio.h is not part of some default Solaris installations.
It can be installed with this command:
Code:
# pkg install system/header

The Following User Says Thank You to jlliagre For This Useful Post:
fmesilva (01-04-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[solved] cc can't find stdio.h header solaris_user Solaris 0 09-11-2011 07:19 AM
FILE structure - stdio.h nikunjbadjatya Programming 5 12-20-2010 10:24 AM
stdio.h vs unistd.h I/O majid.merkava Programming 7 09-16-2010 04:53 PM
Atomic Read and Write with stdio majid.merkava Programming 1 09-13-2010 11:18 AM
ksh not found in solaris capri_drm UNIX for Dummies Questions & Answers 6 12-01-2008 12:45 PM



All times are GMT -4. The time now is 02:32 PM.