Say I have the following:
Foo::Foo() {
value = 25; //default constructor...
}
Foo::Foo(Enum bar) {
value = (int)bar; //purpose is to allow an integer to take enum constant's integer value.
}
from...
enum Enum
{
A = 25,
B = 50,
}
class Foo
{
public:
Foo();
Foo(Enum bar);
private:
int value;
}
Yet, if I do the following:
Enum bar = A; //A = 25
Foo * foo = new Foo(A); //error: "undefined reference to Foo::Foo(Enum)"
This is in Eclipse CDT 3.6. Why is this happening? Is there anything I can do about this to solve the problem?
Foo::Foo(Enum bar)implemented? Is that file included in the project file (i.e., is it actually being compiled)?