Compile error

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

    Compile error

    I am trying to compile a code that includes header from both oracle
    and postgres

    /usr/local/pgsql/include/server/c.h:420: error: conflicting
    declaration 'typedef struct varlena text'
    /opt/oracle/product/10.2.0/rdbms/public/oratypes.h:196: error: 'text'
    has a previous declaration as `typedef oratext text'

    How do i fix this ?
  • Eric Sosman

    #2
    Re: Compile error

    iavian wrote:
    I am trying to compile a code that includes header from both oracle
    and postgres
    >
    /usr/local/pgsql/include/server/c.h:420: error: conflicting
    declaration 'typedef struct varlena text'
    /opt/oracle/product/10.2.0/rdbms/public/oratypes.h:196: error: 'text'
    has a previous declaration as `typedef oratext text'
    >
    How do i fix this ?
    Best not to try: Keep the two conflicting headers apart
    from each other by compiling the Oracle- and Postgres-using
    parts of the program in separate modules.

    But if you *must* try to force two square pegs into the
    same round hole, you *might* be able to do something like

    #define text vtext
    #include "c.h" /* the "struct varlena" one */
    #undef text

    #define text otext
    #include "oratypes.h " /* the "oratext" one */
    #undef text

    .... and then use "vtext" and "otext" throughout the rest of
    the code. No guarantees that this will work, though: much
    depends on what else these headers may be doing.

    There may be further troubles awaiting you if you get
    past the compilation errors, if the libraries that accompany
    these headers contain external definitions that clash. For
    example, if each defines its own connectToDataba se() function
    your compilation difficulties will be only the beginning ...

    --
    Eric Sosman
    esosman@ieee-dot-org.invalid

    Comment

    Working...