PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Compile error
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Compile error

Réponse
 
LinkBack Outils de la discussion
Vieux 08/05/2008, 13h54   #1
iavian
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 ?
  Réponse avec citation
Vieux 08/05/2008, 14h23   #2
Eric Sosman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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 connectToDatabase() function
your compilation difficulties will be only the beginning ...

--
Eric Sosman
esosman@ieee-dot-org.invalid
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09777 seconds with 10 queries