Clang complains

Clang 3.2 complains following but the system has the stdlib.h in /usr/include.

What could be the reason? is clang specifically looking for cstdlib?

/home/govind/CodeSpace/pegasus/src/Pegasus/Common/Config.h:133:10: fatal error: ‘cstdlib’ file not found

#include <<<<<<<<<
^
1 error generated.

[govind@localhost pegasus]$ locate stdlib.h

/usr/include/stdlib.h <<<<<<<<<<
/usr/include/bits/stdlib.h
/usr/include/boost/cstdlib.hpp
/usr/include/c++/4.5.1/tr1/stdlib.h
/usr/include/freetype2/freetype/config/ftstdlib.h
/usr/share/man/man0p/stdlib.h.0p.gz

and Following command also shows the

[govind@localhost pegasus]$ echo | gcc -print-prog-name=cc1 -v
ignoring nonexistent directory “/usr/lib/gcc/i686-redhat-linux/4.5.1/include-fixed”
ignoring nonexistent directory “/usr/lib/gcc/i686-redhat-linux/4.5.1/…/…/…/…/i686-redhat-linux/include”
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include
/usr/lib/gcc/i686-redhat-linux/4.5.1/include

/usr/include <<<<<<<<
End of search list.

Analyzing compilation unit
Performing interprocedural optimizations
<*free_lang_data> <early_local_cleanups> Assembling functions

Yes, clang is specifically looking for a file named "cstdlib" in the include path.

1. In general, it's better all-around if the compiler doesn't have hacks about
specific file names.

2. <cstdlib> specifically is usually more than just "#include <stdlib.h>" because
it's required to declare things in namespace std, and that's often done
after-the-fact with using declarations.

John.

Hi,

Clang 3.2 complains following but the system has the stdlib.h in
/usr/include.

What could be the reason? is clang specifically looking for cstdlib?

/home/govind/CodeSpace/pegasus/src/Pegasus/Common/Config.h:133:10: fatal
error: 'cstdlib' file not found

#include <cstdlib> <<<<<<<<<

        ^
1 error generated.

[govind@localhost pegasus]$ locate stdlib.h

/usr/include/stdlib.h <<<<<<<<<<

/usr/include/bits/stdlib.h
/usr/include/boost/cstdlib.hpp
/usr/include/c++/4.5.1/tr1/stdlib.h
/usr/include/freetype2/freetype/config/ftstdlib.h
/usr/share/man/man0p/stdlib.h.0p.gz

You told the compiler to look for a file named "cstdlib". The compiler
complained that it cannot find a file named "cstdlib".
The fact that you have a file named "stdlib.h" does not help the
compiler in any way.

_IF_ the compiler found "cstdlib" and saw that it contains #include
<stdlib.h> then yes, having a stdlib.h would be important.

Csaba