Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


Why STDLIB.H is missing

"stdlib.h", the standard include file for ANSI C, is not available on all
Athena workstations.  The standard compiler on Athena is not ANSI
compiliant, and as such, doesn't have that header file available for it;
the stdio.h file defines the standard I/O functions, but does not have
everything that stdlib.h does. 

Athena is not yet running a fully ANSI compliant system; there are several
other header files described in the standard that do not exist.  To write a
program that will compile correctly on both ANSI and non-ANSI systems, put
this text at the top of your .c file:

	#if defined(__STDC__) && !defined(__HIGHC__)
	#include <stdlib.h>
	#endif

The symbol __STDC__ is always defined by an ANSI C compiler, and that code
tells the compiler only to #include <stdlib.h> if it is defined, so it WILL
NOT be included on non-ANSI systems.

The functions that are declared in stdlib.h on an ANSI system are, for the
most part, available in libc.a (the library that is automatically linked with
every C program).

For more information on these issues, see the stock answers on "What C
COMPILERS are available" and "Differences between ANSI C and TRADITIONAL C".


Last Updated: 7/25/96

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.