Trouble accessing interfaces of my include files [message #733906] |
Wed, 05 October 2011 22:32 |
Josiah Messages: 7 Registered: October 2011 |
Junior Member |
|
|
I'm now having a strange problem:
I am defining my interface for a dynamic library I'm building. It looks like it will be fairly large, so I'm splitting the interface up into several headers.
I have the main header, which I'll call "Main.h", and then several helper headers that I want to include in Main.h, which I'll call "Helper1.h" and "Helper2.h"
So, I include Helper1.h and Helper2.h in my Main.h file, but I'm still getting errors saying the enums and classes from those files cannot be found.
heres a code example of what I have:
Helper1.h
#ifndef HELPER1_H_
#def HELPER1_H_
namespace Main {
enum Helper1Enum {
Element1 = 1,
Element2
};
virtual class IHelper1 {
virtual ~IHelper1Class();
virtual int SomeMethod() = 0;
};
}
#endif
Helper2.h
#ifndef HELPER1_H_
#def HELPER1_H_
namespace Main {
enum Helper2Enum {
Element1 = 1,
Element2
};
virtual class IHelper2 {
virtual ~IHelper1Class();
virtual int SomeMethod() = 0;
};
}
#endif
Main.h
#ifndef MAIN_H_
#def MAIN_H_
#include "Helper1.h"
#include "Helper2.h"
using namespace Main;
namespace Main {
virtual class IHelper2 {
virtual ~IHelper1Class();
virtual IHelper1 FirstMethod(Helper1Enum param) = 0;
virtual IHelper2 SecondMethod(Helper2Enum param) = 0;
};
}
#endif
So this code gives me the error output:
Type 'Helper1Enum' could not be resolved
Type 'Helper2Enum' could not be resolved
Type 'IHelper1' could not be resolved
Type "IHelper2' could not be resolved
** Edit **
Forgot to mention, I'm using Eclipse IDE with the gcc C++ 4.5.2 compiler and gdb 7.2 on Ubuntu 11.04 as a Virtualbox guest on a Windows 7 host.
[Updated on: Wed, 05 October 2011 22:35] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01839 seconds