Bonjour,

J'ai un probleme avec un heritage en c++.

J'ai une classe GeometryElement avec un fichier header geometryelement.h contenant le constructeur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
GeometryElement(wstring a_name, GeometryType a_geometryType, unsigned int a_x_coord, unsigned int a_y_coord, unsigned int a_z_coord, unsigned int a_geometryDimension);
J'ai aussi un fichier source geometryelement.cpp avec le code du constructeur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
GeometryElement::GeometryElement(wstring a_name, GeometryType a_geometryType, unsigned int a_x_coord, 
unsigned int a_y_coord, unsigned int a_z_coord, unsigned int a_geometryDimension): m_name_geometryElement(a_name), m_geometryType(a_geometryType), 
m_x_coord(a_x_coord), m_y_coord(a_y_coord), m_z_coord(a_z_coord), m_geometryDimension(a_geometryDimension){}
Je souhaite ensuite avoir une classe VoxelElement qui herite de GeometryElement.
Dans le header VoxelElement.h:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
VoxelElement(wstring a_name, unsigned int a_x_coord, unsigned int a_y_coord, unsigned int a_z_coord, unsigned int a_geometryDimension, unsigned int a_dimensionType);
Dans le ficher source VoxelElement.cpp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
VoxelElement::VoxelElement(wstring a_name, unsigned int a_x_coord, 
unsigned int a_y_coord, unsigned int a_z_coord, unsigned int a_geometryDimension):
GeometryElement(a_name, GeometryElement::VOXEL, a_x_coord, a_y_coord, a_z_coord, a_geometryDimension) {}
Le compilateur refuse la compilation du code du constructeur VoxelElement:
Error : illegal function overloading
voxelelement.cpp line 21 signed int a_y_coord, unsigned int a_z_coord, unsigned int a_geometryDimension):
Error : ')' expected
voxelelement.cpp line 22 GeometryElement(a_name, GeometryElement::VOXEL, a_x_coord, a_y_coord, a_z_coord, a_geometryDimension) {}


Je n'arrive pas a voir reellement d'ou provient l'erreur. Merci de votre aide

Yann