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

Discussion in 'C++' started by shankha, May 5, 2009.

  1. shankha

    shankha Guest

    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
    shankha, May 5, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. iqbal
    Replies:
    1
    Views:
    848
    Victor Bazarov
    Jun 24, 2003
  2. John Salerno
    Replies:
    30
    Views:
    1,951
    Stephan Kuhagen
    Aug 10, 2006
  3. Replies:
    3
    Views:
    599
  4. Yves Dorfsman

    #!/usr/bin/env python vs. #!/usr/bin/python

    Yves Dorfsman, May 2, 2008, in forum: Python
    Replies:
    27
    Views:
    1,988
    Tim Roberts
    May 10, 2008
  5. anne001
    Replies:
    1
    Views:
    436
Loading...

Share This Page