Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

including header files

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
how can i include header files for c programs under liux?
iam not able to include any file except stdio.h?
how have i to compile it to include the header files like
ctype
 
I am sure you have an answer by now but if not, here is a comment from 'Beginners 'c' ...

Standard header files (those supplied by your 'c' compiler vendor) are placed into '/usr/include' and in folders below that one. These are referenced in your 'c' program by placing '<>' around them. This means that <stdio.h> will be searched for in '/usr/include' Standard files in folders below '/usr/include' must include the path prefix. An example of this would be '<sys/ipc.h>'

Non-standard header files, those created by you or supplied by a third party, can be located just about anywhere. In your 'c' program these are referred to with '&quot;&quot;' around them. Because they are not limited to where they are located, it is common practice to put the full pathname within the quotes ie, &quot;/usr/myfolder/myproject/myheader.h&quot;. The exception to this is if the header file is located in the same folder you are in when you start the compile.

Finally, 'Makefiles' and the 'c' compiler allow you to provide search paths to any non-standard header file locations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top