• C

cc inches.c gives an error - cc does not see <stdio.h>, not sure why ...

alex /home/alex/c> more inches.c                            
/* This program converts 10 feet to inches. */                        
#include <stdio.h>                                                    
int main()                                                            
        int inches, feet;                                            
        feet = 10;                                                    
        inches = feet * 12;                                          
        printf("There are %d inches in %d feet.\n", inches, feet);    
alex /home/alex/c>            
NCR High Performance C Compiler R3.0c                                          
(c) Copyright 1994-97, NCR Corporation                                          
(c) Copyright 1987-97, MetaWare Incorporated                                    
E "inches.c",L3/C1:     Can't open "stdio.h": No such file or directory        
Unable to proceed                                                              
Who is Participating?
ankuratvbConnect With a Mentor Commented:
Check in ur include path,whether u have stdio.h or not.
It might have got deleted or ur path is set to the wrong directory and it is not able to find
the stdio.h. file

To check this,just give any other header file name for include such as stdlib.h for e.g. or math.h

If it still gives u the same error,ur path for include files is wrong otherwise if u dont get error
for other header files,ur stdio.h has been deleted.
andrewjbConnect With a Mentor Commented:
You're probably missing some environmental variable to tell cc where to look for the include files...

But, sorry, don't know your platform so can't tell you more..

(Try man cc!)
(Or ask someone who's compiling OK to check env vars)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.