Conflicting gethostname function definition on Solaris 9

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Ky

    Conflicting gethostname function definition on Solaris 9

    Hello:

    Building Python works fine. Now I am trying to build my own python
    module on Solaris 9, but I'm getting the following conflict:

    In file included from
    /wrk/src/test/tools/local/include/python2.2/Python.h:62,
    from elxml.cpp:20:
    /wrk/src/test/tools/local/include/python2.2/pyport.h:333: declaration
    of C function `int gethostname(cha r*, int)' conflicts with
    /usr/include/unistd.h:274: previous declaration `int gethostname(cha r*, long
    unsigned int)' here

    Did I do something wrong?

    Thanks

    -John


  • John Ky

    #2
    Re: Conflicting gethostname function definition on Solaris 9

    To work around this, I had to do two things:

    1. not defined "SOLARIS"
    2. put "python.h" first in the header file.

    "John Ky" <johnk@aurema.c ommercial> wrote in message
    news:1069977306 .415163@cousin. sw.oz.au...[color=blue]
    > Hello:
    >
    > Building Python works fine. Now I am trying to build my own python
    > module on Solaris 9, but I'm getting the following conflict:
    >
    > In file included from
    > /wrk/src/test/tools/local/include/python2.2/Python.h:62,
    > from elxml.cpp:20:
    > /wrk/src/test/tools/local/include/python2.2/pyport.h:333: declaration
    > of C function `int gethostname(cha r*, int)' conflicts with
    > /usr/include/unistd.h:274: previous declaration `int gethostname(cha r*,[/color]
    long[color=blue]
    > unsigned int)' here
    >
    > Did I do something wrong?
    >
    > Thanks
    >
    > -John[/color]


    Comment

    • John Ky

      #3
      Re: Conflicting gethostname function definition on Solaris 9


      "John Ky" <johnk@aurema.c ommercial> wrote in message
      news:1070335876 .873683@cousin. sw.oz.au...[color=blue]
      > To work around this, I had to do two things:
      >
      > 1. not defined "SOLARIS"
      > 2. put "python.h" first in the header file.[/color]

      Oops - I meant include "python.h" first before any other header
      from my *.cpp file.

      -John


      Comment

      Working...