Implementation File Error: C2011

I've been looking of solutions but apparently this error isn't quite narrow enough,
The exact error is
1
2
1>c:\users\bombshell\documents\visual studio 2010\projects\indigoengine\indigoengine\indigo.cpp(6): error C2011: 'Indigo::DXManager' : 'class' type redefinition
1>          c:\users\bombshell\documents\visual studio 2010\projects\indigoengine\indigoengine\indigo.h(18) : see declaration of 'Indigo::DXManager'

Indigo.cpp being an implementation File
Indigo.h being the header file for Indigo.cpp's use
but I can't get my head around the error,
In Indigo.h I'm using
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef INDIGO_H
#define INDIGO_H

// Include windows and D3D

namespace Indigo
{
class DXManager
{
//function prototypes
};
};

#endif 


In Indigo.cpp
1
2
3
4
5
6
7
8
9
10
#include "Indigo.h"

namespace Indigo
{
class DXManager
{
//variable declaration
//full functions
};
};


I'm sure its just me making a "Noob to C++" mistake XD
But for the life of me I can't find my exact problem in google -.-

Any help is appreciated,
Thanks in advanced,
Bombshell
Like the error said. You're defining the class twice. What this should be is
1
2
3
4
5
6
7
//.h
namespace Name {
   class Class{
      int Var;
      void Func();
   };
}

and
1
2
3
4
5
6
//.cpp
namespace Name {
   void Class::Func() {
      //...
   }
}
Thanks loads :D
I knew I must have been making a silly mistake!
well lesson learned now, thanks :)
Just so you know, the class defined in the header file can contain full functions not only prototypes, but they'll be inlined.

Example:
1
2
3
4
5
6
7
8
// header.h
class A
{
    void function() // this function automatically inlined
    {
        // do something
    }
};

http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
Topic archived. No new replies allowed.