using stdlib.h from /usr/include or /usr/vacpp/include

S

shankha

Hi,
When i try to use stdlib.h from /usr/vacpp/include i get compilation
errors but if i pick up the header file from /usr/include i do not get
compilation problems. By default for a C++ compiler i think header
files will be picked up from the compiler header file location(/usr/
vacpp) and not system location (/usr/inlcude).

Is there a rule that stdlib.h should be included from /usr/include
area and not /usr/vacppp area.

Platform : AIX, Power6
Complier : xlC (C++)

Code :
#include <stdio.h>
#include <strings.h>
#include </usr/include/stdlib.h>

int main()
{
char * hello = "hello";
int i = abs(2);
char ss[10];
strcpy(ss, hello);
printf ("%s\n",hello);
printf ("%d\n",i);
return 0;
}

xlC 1.cpp


error :
"/usr/vacpp/include/stdlib.h", line 133.22: 1540-0403 (S) "div(int,
int)" is already defined.
"/usr/include/stdlib.h", line 727.22: 1540-0425 (I) "div" is defined
on line 727 of "/usr/include/stdlib.h".
"/usr/include/stdlib.h", line 275.33: 1540-0424 (I) "div" is declared
on line 275 of "/usr/include/stdlib.h".
"/usr/vacpp/include/stdlib.h", line 134.36: 1540-0403 (S) "div(long,
long)" is already defined.
"/usr/include/stdlib.h", line 728.36: 1540-0425 (I) "div" is defined
on line 728 of "/usr/include/stdlib.h".
"/usr/vacpp/include/stdlib.h", line 135.23: 1540-0403 (S) "ldiv(long,
long)" is already defined.
"/usr/include/stdlib.h", line 729.23: 1540-0425 (I) "ldiv" is defined
on line 729 of "/usr/include/stdlib.h"
.....
.....
.....


thanks
shankha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top