M
martinacevedo
I made a library in c++ gcc(3.4) with some classes. Within a classes,
I have an enumerator type, the problem is when I use the library from
another c++ project( the library is dynamic linked) I can't use a fully
qualified name for accessing the enum values. The compiler says that
the name is not a class or namespace
ex:
in the library I have a class like this ..
... Test.h
#include <iostream>
#include <cstdlib>
class Test{
public:
enum TestEnum{
valuetest1,
valuetest2
};
TestEnum enumVar;
Test();
~Test();
};
and the corresponding cxx
in client project i have main function
... test.cxx
#include "test.h"
void main(){
Test tst;
Test::TestEnum MyEnumVar ; //this line complie wtihout errors
tdt.enumVar=Test::TestEnum::valuetest1;//<-- gcc says
Test::TestEnum is not a class or namespace valuetest1 is not defined at
this scope
}
Any ideas or suggestions
I have an enumerator type, the problem is when I use the library from
another c++ project( the library is dynamic linked) I can't use a fully
qualified name for accessing the enum values. The compiler says that
the name is not a class or namespace
ex:
in the library I have a class like this ..
... Test.h
#include <iostream>
#include <cstdlib>
class Test{
public:
enum TestEnum{
valuetest1,
valuetest2
};
TestEnum enumVar;
Test();
~Test();
};
and the corresponding cxx
in client project i have main function
... test.cxx
#include "test.h"
void main(){
Test tst;
Test::TestEnum MyEnumVar ; //this line complie wtihout errors
tdt.enumVar=Test::TestEnum::valuetest1;//<-- gcc says
Test::TestEnum is not a class or namespace valuetest1 is not defined at
this scope
}
Any ideas or suggestions