Find the answer to your Linux question:
Results 1 to 7 of 7
i want to know the path of the header files of C. eg where is stdio.h is actually stored. is it in / or /bin or /home. how do i ...
  1. #1
    Just Joined! charu86's Avatar
    Join Date
    Jul 2009
    Location
    19.11N 72.84E
    Posts
    13

    Post Path of Headers

    i want to know the path of the header files of C.
    eg where is stdio.h is actually stored. is it in / or /bin or /home.
    how do i open the header file to glance through it's contents?

    am using fedora 9

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    It is most certainly in / as this is where the whole filesystem resides

    /bin is for binary system programs, so it is likely not to be found there.
    /home is where the users store their private data.

    It may be somewhere under /usr
    Try
    "find /usr -name stdio.h"

    On my system the file is in /usr/include/
    Debian GNU/Linux -- You know you want it.

  3. #3
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    I think it's in /usr/include in all systems. And you open individual headers with less or any text editor.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  4. #4
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    I'm moving this to a more appropriate forum.

    But in any event, indeed. C header files are stored in /usr/include, but be aware that the standard library is very complicated. Their header files are pretty difficult to read. But all header files will be somewhere in there. For instance, the file "sys/linux.h" is stored at /usr/include/sys/linux.h.

    The binaries that store the actual machine code for the files is stored in /usr/lib/. For instance, the standard libc is /usr/lib/libc.so, and the math libraries are /usr/lib/libm.so.
    DISTRO=Arch
    Registered Linux User #388732

  5. #5
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Quote Originally Posted by Cabhan View Post
    The binaries that store the actual machine code for the files is stored in /usr/lib/. For instance, the standard libc is /usr/lib/libc.so, and the math libraries are /usr/lib/libm.so.
    Well, on my system, they're in /lib, the dynamically linked ones anyway and those are the ones you mostly use. The ones in /usr/lib are for static linking. But gtk and its associated libraries (glib, pango, cairo, etc) are in /usr/lib.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  6. #6
    Just Joined! chigurh's Avatar
    Join Date
    Jul 2009
    Posts
    24
    The include files being in /usr/include is part of the Filesystem Hierarchy Standard.

    Concerning /lib:
    /lib : Essential shared libraries and kernel modules
    Purpose

    The /lib directory contains those shared library images needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin
    Concerning /usr/lib:
    /usr/lib : Libraries for programming and packages
    Purpose

    /usr/lib includes object files, libraries, and internal binaries that are not intended to be executed directly by users or shell scripts.

    Applications may use a single subdirectory under /usr/lib. If an application uses a subdirectory, all architecture-dependent data exclusively used by the application must be placed within that subdirectory.

  7. #7
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    @hazel: Interesting. When I was last running Ubuntu to do some work for a class (this was in the spring), libc.so was in /usr/lib, and the one with debug symbols was in /usr/lib/debug.

    There tends to be a lot of confusion about subdirectories of / and subdirectories of /usr, and in my experience, it can tend to vary a great deal between different distros. But now that I think about it, you are right, and I would expect libc.so to have been in /lib, so you're not relying on the /usr mountpoint.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...