Multiple definition error in c++
<p>Hi when i try to run c++ code I am getting the following error</p>

<p><code>mainwindow.h</code></p>

<pre><code>class MainWindow
{


  public:
     MainWindow();
    ~MainWindow();
     method();
};
</code></pre>

<p>and </p>

<p><code>mainwindow.cpp</code></p>

<pre><code>#include mainwindow.h
MainWindow::MainWindow(){
   //some code here

}

MainWindow::~MainWindow(){
  //some code here

}
MainWindow::method(){
  //some code here

}
</code></pre>

<p>when i compile this from eclipse cdt i got the error saying multiple defintion of <code>MainWindow::method()</code> .
Is this the correct way or iam doing anything wrong.
Can any one please help me what to do?</p>
