Where are the c header files on my system?

Jerry Feldman gaf at blu.org
Tue May 19 07:46:15 EDT 2009


On 05/19/2009 01:33 AM, Lori Nagel wrote:
> I've been using gcc in Linux and cc in Unix. 
> I have not been using an IDE, only the terminal shell and a text
> editing program for the C files. On both computers c programs compile
> and run, however, the compilers are different and have different options,
> and some code that compiles and runs on one doesn't on the other.  (what I mean is why is gcc so lax while cc is so mean.) 
>
> What
> I want to know is if there any easy way I could find out where my .h
> files are  on my computers such as stdio.h? Also, would I be able to
> find the function prototypes for things  like scanf in them or would I
> have to go somewhere else? 
>
> Another thing, why oh why did they decide to seperate out libm.a from the rest of the C programming libriaries so that you have to include it? It used to make me so upset until I read intro to gcc. 
>
> Please someone answer my question
> because I have been wanting to know the answer for about 3 years now,
> and I think that is a long enough time to wait.  I have done enough reading of manuals to know that most of them don't answer the questions that people have. I'm planning to write the ultimate newbie C programming book for Gnu/Linux because it doesn't currently exist. 
>
>   
Sorry, I forgot the answer the rest. The function prototypes are in the 
standard header files.
The math library has been historically separate from the standard C 
runtime library forever. It was a decision made way back before I 
learned C in 1980. If you look at the man page for the math functions it 
notes that "Link with -lm". Additionally, libraries are in /lib, 
/usr/lib, and /usr/local/lib

In addition, some Unix systems have additional locations, such as 
/usr/ucb (if I recall).  Remember that on some Unix systems you may be 
able to build a System V or BSD variant, but all is in the man pages.


-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20090519/1f904c28/attachment.bin 


More information about the gnhlug-discuss mailing list