Problème avec paramètre d'une fonction (classe)
Bonjour,
je suis entrain d'écrire un programme contenant trois classes (Point, Vecteur, objet). J'essaye de faire une fonction qui prend pour paramètre un pointeur objet, mais j'ai une erreur à la compilation :
Code:
1 2 3 4 5 6 7 8 9 10 11
| make
g++ -c -o main.o main.cpp
In file included from objet.h:9,
from main.cpp:9:
fonctions.h:4: error: variable or field CalculForceAcceleration declared void
fonctions.h:4: error: objet was not declared in this scope
fonctions.h:4: error: o was not declared in this scope
fonctions.h:4: error: expected primary-expression before const
main.cpp: In function int main():
main.cpp:57: error: CalculForceAcceleration was not declared in this scope
make: *** [main.o] Erreur 1 |
Voici en gros la structure du programme :
Les classes Point, Vecteur et objet sont contenues dans les fichiers Point.h, Point.cpp, Vecteur.h, Vecteur.cpp, objet.h et objet.cpp
Code:
1 2 3 4 5 6 7 8
| fonctions.h
#ifndef _fonctions_H_
#define _fonctions_H_
void CalculForceAcceleration(objet *, const int &);
#endif |
Code:
1 2 3 4 5 6 7 8 9 10 11
| fonctions.cpp
#include "Point.h"
#include "Vecteur.h"
#include "objet.h"
using namespace std;
void CalculForceAcceleration(objet * o, const int & N)
{
...
} |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| main.cpp
#include <iostream>
...
#include "Point.h"
#include "Vecteur.h"
#include "objet.h"
#include "fonctions.h"
using namespace std;
int main()
{
...
CalculForceAcceleration(o,N);
...
} |
Je n'arrive pas à trouver mon erreur. Merci d'avance pour votre aide.