Compilation séparée sous devcpp
Bonjour à tous,
Je suis en train de réaliser un petit projet sous devcpp et je rencontre actuellement un problème lié au découpage de mon code dans différents fichiers.
Je tiens à préciser que je soumets mon problème dans la catégorie devc++ car je pense qu'il est lié à cet IDE.
Le découpage est le suivant :
1 fichier constante.hpp
2 fichier .cpp : main.cpp et fonctions.cpp
Au début des 2 fichiers .cpp, j'ai rajouter un
Code:
#include "constante.hpp
Cependant à la compilation j'ai droit au message suivant :
Citation:
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:4: multiple definition of `ecran'
Obj/main.o(.bss+0x0):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:4: first defined here
Obj/fonctions.o(.bss+0x4): In function `Z6hasardi':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:4: multiple definition of `typeImp'
Obj/main.o(.bss+0x4):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:4: first defined here
Obj/fonctions.o(.bss+0x20): In function `Z6hasardi':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:9: multiple definition of `tabProf'
Obj/main.o(.bss+0x20):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:6: first defined here
Obj/fonctions.o(.bss+0x60): In function `Z6hasardi':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:14: multiple definition of `tabImpact'
Obj/main.o(.bss+0x60):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:14: first defined here
Obj/fonctions.o(.bss+0x9c0): In function `Z8mainLoopv':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:114: multiple definition of `viseur'
Obj/main.o(.bss+0x9c0):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:137: first defined here
Obj/fonctions.o(.bss+0x9cc): In function `Z8mainLoopv':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:114: multiple definition of `shoot'
Obj/main.o(.bss+0x9cc):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:137: first defined here
Obj/fonctions.o(.bss+0x9d4): In function `Z8mainLoopv':
C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/fonctions.cpp:114: multiple definition of `ind_cour'
Obj/main.o(.bss+0x9d4):C:/Documents and Settings/Mathieu/Mes documents/SDL/Jeu de shoot/Src/main.cpp:137: first defined here
collect2: ld returned 1 exit status
make.exe: *** [Avenger.exe] Error 1
Voila je comprend pas trop, étant donné que les variables concernées par ce message ne sont définis qu'une fois dans constante.hpp
Merci d'avance pour vos réponses