bonjour,
lorsque je compile j'ai plein d'erreur me disant qu'il ya des multiple definitions dans mes fichiers objets :
ds tou les fichier .h il y a au debut le #ifndef _FICHIER_H_
#define _FICHIER_H_
ET #endif a la fin
j'ai 3 classes : Matrice :
ds Matrice.h il y a #include"graphique.h"
ds MatriceFonct.cpp il y a #include"Matrice.h"
TabSucc :
ds .h il y a aussi graphique.h
ds cpp il y a TabSucc.h
Goriente :
ds.h il y a Matrice.h et TabSucc.h
ds cpp : Goriente.h
j'ai compiler les fichiers cpp avec g++ -c et il n'y a pas eu d'erreur
Par contre qd je compile le tout :
g++ -o monprog monprog.cpp MatriceFonct.o TabSuccFonct.o GorienteFonct.o
voila : le resulta
[root@jojo projetSD]# g++ -o projet23 projet23.cpp GorienteFonct.o MatriceFonct.o TabSuccFonct.o -lcurses
GorienteFonct.o: In function `LigneH(int, int, int)':
GorienteFonct.o(.text+0x0): multiple definition of `LigneH(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x0): first defined here
GorienteFonct.o: In function `LigneV(int, int, int)':
GorienteFonct.o(.text+0x80): multiple definition of `LigneV(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x80): first defined here
GorienteFonct.o: In function `ConstruireEcran(void)':
GorienteFonct.o(.text+0x104): multiple definition of `ConstruireEcran(void)'
/tmp/ccjCzXM6.o(.text+0x104): first defined here
GorienteFonct.o: In function `Retablissement(void)':
GorienteFonct.o(.text+0x114): multiple definition of `Retablissement(void)'
/tmp/ccjCzXM6.o(.text+0x114): first defined here
MatriceFonct.o: In function `LigneH(int, int, int)':
MatriceFonct.o(.text+0x0): multiple definition of `LigneH(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x0): first defined here
MatriceFonct.o: In function `LigneV(int, int, int)':
MatriceFonct.o(.text+0x80): multiple definition of `LigneV(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x80): first defined here
MatriceFonct.o: In function `ConstruireEcran(void)':
MatriceFonct.o(.text+0x104): multiple definition of `ConstruireEcran(void)'
/tmp/ccjCzXM6.o(.text+0x104): first defined here
MatriceFonct.o: In function `Retablissement(void)':
MatriceFonct.o(.text+0x114): multiple definition of `Retablissement(void)'
/tmp/ccjCzXM6.o(.text+0x114): first defined here
TabSuccFonct.o: In function `LigneH(int, int, int)':
TabSuccFonct.o(.text+0x0): multiple definition of `LigneH(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x0): first defined here
TabSuccFonct.o: In function `LigneV(int, int, int)':
TabSuccFonct.o(.text+0x80): multiple definition of `LigneV(int, int, int)'
/tmp/ccjCzXM6.o(.text+0x80): first defined here
TabSuccFonct.o: In function `ConstruireEcran(void)':
TabSuccFonct.o(.text+0x104): multiple definition of `ConstruireEcran(void)'
/tmp/ccjCzXM6.o(.text+0x104): first defined here
TabSuccFonct.o: In function `Retablissement(void)':
TabSuccFonct.o(.text+0x114): multiple definition of `Retablissement(void)'
/tmp/ccjCzXM6.o(.text+0x114): first defined here
collect2: ld returned 1 exit status
help me please.