views:

945

answers:

5

Where could I find the list of all header files in c/c++?

While I am building a library I am getting an error like tree.h not found. I suppose this is a standard header file in c/c++. This raised in me the curiosity to know all the header files and their contribution.

Is there a place I can search for?

I am working on Solaris Unix.

+5  A: 

http://www.cplusplus.com/reference/ lists all the standard C++ headers and the C++ wrappers of C header files.

tree.h is not part of the standard library.

Adam Bowen
+7  A: 

Try here : http://www.cplusplus.com/reference/

However, you may also be refering to the header files of your OS. These can be found either on MSDN (Windows) or by man command (POSIX systems). Or another source if you're on another OS.

Kornel Kisielewicz
A: 

This is a compiler dependent issue.

In linux with gcc usually in: /usr/include

fortran
Are only standard C/C++ include files in that directory?
OregonGhost
@OregonGhost: If the /usr/include in my Linux distribution is anything to go by, then no. There are curses includes there, and ones for GL and lots of other stuff I don't even recognize.
Carl Smotricz
@OregonGhost they're not the only ones there, usually it's shared with all the header files of the "-dev" packages installed...
fortran
@Carl Smotricz and fortran: That's what I expected, and that means that this won't be of much use, unless benjamin button just wanted to find out which files are available on his local system. On the other hand, reading his question carefully does not really make clear if he wanted to find out only standard files or all available files :)
OregonGhost
yep, he asked where could he search for them, and that's the place xD
fortran
+1  A: 

I found this Wikipedia entry on the C standard library which contains, lists of C header files and detailed information on which standard they're part of. That gives you a nice historical perspective and some other, similar details.

Of course that's just C. There's a similar article to be found under "C++ standard library". That also has references to some other libraries which may not be "standard" per se but without which C++ would feel "crippled" to some people used to working with the extensions.

Carl Smotricz
+6  A: 

The header 'tree.h' is not standard anywhere.

The 15 standard headers in C89 are:

  • <assert.h>
  • <ctype.h>
  • <errno.h>
  • <float.h>
  • <limits.h>
  • <locale.h>
  • <math.h>
  • <setjmp.h>
  • <signal.h>
  • <stdarg.h>
  • <stddef.h>
  • <stdio.h>
  • <stdlib.h>
  • <string.h>
  • <time.h>

The extra headers introduced in C94 (Amendment 1) are:

  • <iso646.h>
  • <wchar.h>
  • <wctype.h>

The extra headers in C99 are:

  • <complex.h>
  • <fenv.h>
  • <inttypes.h>
  • <stdbool.h>
  • <stdint.h>
  • <tgmath.h>

Note that POSIX requires many more headers. The list below repeats the standard C (C99) headers. Windows requires a different set of headers, of course.

  • <aio.h>
  • <arpa/inet.h>
  • <assert.h>
  • <complex.h>
  • <cpio.h>
  • <ctype.h>
  • <dirent.h>
  • <dlfcn.h>
  • <errno.h>
  • <fcntl.h>
  • <fenv.h>
  • <float.h>
  • <fmtmsg.h>
  • <fnmatch.h>
  • <ftw.h>
  • <glob.h>
  • <grp.h>
  • <iconv.h>
  • <inttypes.h>
  • <iso646.h>
  • <langinfo.h>
  • <libgen.h>
  • <limits.h>
  • <locale.h>
  • <math.h>
  • <monetary.h>
  • <mqueue.h>
  • <ndbm.h>
  • <net/if.h>
  • <netdb.h>
  • <netinet/in.h>
  • <netinet/tcp.h>
  • <nl_types.h>
  • <poll.h>
  • <pthread.h>
  • <pwd.h>
  • <regex.h>
  • <sched.h>
  • <search.h>
  • <semaphore.h>
  • <setjmp.h>
  • <signal.h>
  • <spawn.h>
  • <stdarg.h>
  • <stdbool.h>
  • <stddef.h>
  • <stdint.h>
  • <stdio.h>
  • <stdlib.h>
  • <string.h>
  • <strings.h>
  • <stropts.h>
  • <sys/ipc.h>
  • <sys/mman.h>
  • <sys/msg.h>
  • <sys/resource.h>
  • <sys/select.h>
  • <sys/sem.h>
  • <sys/shm.h>
  • <sys/socket.h>
  • <sys/stat.h>
  • <sys/statvfs.h>
  • <sys/time.h>
  • <sys/times.h>
  • <sys/types.h>
  • <sys/uio.h>
  • <sys/un.h>
  • <sys/utsname.h>
  • <sys/wait.h>
  • <syslog.h>
  • <tar.h>
  • <termios.h>
  • <tgmath.h>
  • <time.h>
  • <trace.h>
  • <ulimit.h>
  • <unistd.h>
  • <utime.h>
  • <utmpx.h>
  • <wchar.h>
  • <wctype.h>
  • <wordexp.h>

Note, too, that X/Open Curses requires another set of headers. There was a new version (Release 7) of that specification released in November 2009 (the first update since 1996 - the primary differences are the loss of official support for termcap and pre-standard C <varargs.h> header).

  • <curses.h>
  • <term.h>
  • <uncntrl.h>

The list goes on. For example, there is no mention of <getopt.h> in these lists, but if you are using GNU Getopt (for long options, for example), you will need and use that header. It is 'standard' on Linux and other platforms that use the GNU C Library, but it is not standard per any ISO standard (unless you count the LSB, Linux Standards Base, but that is primarily about libraries rather than headers).

Jonathan Leffler