K
Kaila
I'm using metroworks codewarrior and can't solve a redeclariotin of type
problem
I have several classes and each of them need to have a custom type called
enum X
now what I was thinking is to put the type in a seperate file and simply
attach it as a librabry to my main as follows:
In main.cpp
#include "X.hpp" //file with the enum type
#include "classe1.hpp" //classes...
#include "classe2.hpp"
If I leave it like that my classes do not see the declaration of a type X
If I attach the file into each class then I have a redeclaration problem as
my main sees the declaration twice (+1 once from the main)
I have tried to declare the enum in the private part of each class and have
the private before public but even then my definitions of each method within
the class do nott see the type.
I have tried to play with the linking order of each file without succes with
various combinations but I think there must be a simple way to have an enum
type being visibles in all files without redeclaration problems ?
problem
I have several classes and each of them need to have a custom type called
enum X
now what I was thinking is to put the type in a seperate file and simply
attach it as a librabry to my main as follows:
In main.cpp
#include "X.hpp" //file with the enum type
#include "classe1.hpp" //classes...
#include "classe2.hpp"
If I leave it like that my classes do not see the declaration of a type X
If I attach the file into each class then I have a redeclaration problem as
my main sees the declaration twice (+1 once from the main)
I have tried to declare the enum in the private part of each class and have
the private before public but even then my definitions of each method within
the class do nott see the type.
I have tried to play with the linking order of each file without succes with
various combinations but I think there must be a simple way to have an enum
type being visibles in all files without redeclaration problems ?