I think you are confusing a few things here.
Declaration
In a declaration you just tell the compiler what the data type of a member, variable or function is, or which members and functions a class consists of. For example:
int i;
void MyFunction (int i, double d);
class X
{
X();
};
Declarations normally go into your .h (header) file or the .cpp file if they are just local to that file. You can include that .h file from as many .cpp files as you like. In fact you have to include in every .cpp file in which you use those definitions.
If you put a guard symbol around the entire .h file contents you can even include it multiple time from the
same .cpp files (which sometimes happens in complex projects when certain headers include other headers):
#ifndef _MYSOANDSOCLASS_H_
#define _MYSOANDSOCLASS_H_
... here goes the contents of the header file
#endif
So that is an important technique to get acquainted with.
Definition
In a definition you tell the compiler to produce code or data entries. For example:
int numOfTableEntries = 0;
void MyFunction (int i, double d)
{
... some code here ...
}
X::X()
{
m_myMemberVariable = 5;
}
Definitions go into the .cpp; with one exception: Inline function definitions can be placed in the header file and the compiler/linker couple "mysteriously" take care that this doesn't lead multiple definitions, even if that header file is included multiple times.
So, in other words: Never place definitions -- i.e. executable code -- in a header file, except inline function definitions!
In your case, the file bmpLoadView when compiled seems to produce a definition for the CCDCDirectControls::CCDCDirectControls(void) function. And the linker now find two such definitions, one produced by your CDCDirectControls file and one by bmpLoadView. So take a look at what bmpLoadView.cpp contains and what it includes. Somewhere must be a definition of CCDCDirectControls::CCDCDirectControls(void) which doesn't belong there.
As for your amendment of the question:
Don't use the guard-symbol technique
inside a class. That is very confusing and unnecessary.
Why do you want to pre-declare testmethod1? Please show the code that would require that. If you want to use testmethod1 in inline code that comes before the inline definition of testmethod1 that should be fine even without a pre-declaration.