title: Qt namespace duplicate id error
body: <p>I hope is not a question too specific... But I will be really thankfull if you could help!</p>
  
  <p>when I build my application I get this error, do you know why?:</p>
  
  <pre><code>ld: duplicate symbol colors::white      in mainwindow.o and main.o
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Here is the definition of the main:</p>
  
  <pre><code>#include &lt;QtGui/QApplication&gt;
  #include "mainwindow.h"
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>and here is the definition of main window:</p>
  
  <pre><code>#include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
      glwidget = new MyGLBox(ui-&gt;centralWidget);
      startTimer(11);
  
  //test frame
      BasicShapes shapes;
  
      Polygon3 square = shapes.create_square(V3(0.,0.,0.),V3(1.0,1.0,1.),colors::cyan);
      Polygon3 cube = shapes.create_cube(V3(-1.,-1.,-1.),V3(1.,1.,1.),colors::purple);
      Polygon3 triangle = shapes.create_triangle(V3(0,1.,0),V3(1.,1.,1.),5.,colors::green);
      //other stuff...
  
      ui-&gt;vLayoutGLview-&gt;addWidget(glwidget); //add the glwidget to the ui framework 
  }
  </code></pre>
  
  <p>colors is a namespace defined in the file colors.h:</p>
  
  <pre><code>namespace colors{
  Color white(1.,1.,1.,0.);
  Color black(0.,0.,0.,0.);
  Color red(1.,0.,0.,0.);
  Color green(0.,1.,0.,0.);
  Color blue(0.,0.,1.,0.);
  Color yellow(1.,1.,0.,0.);
  Color purple(1.,0.,1.,0.);
  Color cyan(0.,1.,1.,0.);
  }
  </code></pre>
  
  <p>here is my file list:</p>
  
  <p>colors.h</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;sstream&gt;
  </code></pre>
  
  <p>mainwindow.h</p>
  
  <pre><code>#include &lt;QMainWindow&gt;
  #include "myglbox.h"
  #include "sceneobject.h"
  </code></pre>
  
  <p>mathvector.h</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;sstream&gt;    
  #include "colors.h"
  </code></pre>
  
  <p>myglbox.h</p>
  
  <pre><code>#include &lt;QGLWidget&gt;
  #include &lt;QtOpenGL&gt;
  #include &lt;vector&gt;
  #include "mathvector.h"
  </code></pre>
  
  <p>sceneobject.h</p>
  
  <pre><code>#include "mathvector.h"
  </code></pre>
  
  <p>I'm pretty sure I didn't included two time the same file(but maybe I missed it), and anyway the header are protected by the header guards.</p>
  
  <p>do you have any idea why I get a duplicate id error? without the namespace it compiled fine, but a namespace with the standard color will be really useful...</p>