_POSIX_C_SOURCE redefined (Problems with Python.h?)

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

    #1

    _POSIX_C_SOURCE redefined (Problems with Python.h?)

    Hey guys!

    I am having some serious problems integrating Python and C, and it's
    strange. Putting it simple, Just as I include Python.h in my C programe
    (without any further python interfacing code), and compile my C code
    with the options -I /usr/include/python2.4 -lpython2.4 too gcc, I get
    the following "warning"

    =====
    In file included from /usr/include/python2.4/Python.h:8,
    from bwfloprating.c: 4:
    /usr/include/python2.4/pyconfig.h:835: 1: warning: "_POSIX_C_SOURC E"
    redefined
    In file included from /usr/include/string.h:26,
    from /root/simgrid/include/xbt/sysdep.h:14,
    from bwfloprating.c: 2:
    /usr/include/features.h:190: 1: warning: this is the location of the
    previous definition
    =====

    The programe compiles, but when I run it, it causes a segmentation
    fault at a point, and doesn't do anything useful. If I remove Python.h,
    and the options to gcc, the code compiles and runs fine (but then I am
    not able to call a python script from within my C code, which I need to
    do).

    Got any idea what the above warning is all about?

    Thanks.

  • Nick Keighley

    #2
    Re: _POSIX_C_SOURCE redefined (Problems with Python.h?)

    irfanhab wrote:

    I am having some serious problems integrating Python and C,
    I think you'd be better off in a pyton news group, this isn't really
    the sort
    of thing comp.lang.c deals with.

    <snip>

    --
    Nick Keighley

    Comment

    Working...