I am trying to create a QMap as a seperate .h .cpp pair because it is a really long list, but doing so generates errors.

Here is the .h
Qt Code:
  1. #ifndef XMLSQLMAP_H
  2. #define XMLSQLMAP_H
  3.  
  4. #include <qmap.h>
  5. #include <qstring.h>
  6.  
  7.  
  8. QMap<QString,QString> xmlsqlmap;
  9.  
  10. #endif
To copy to clipboard, switch view to plain text mode 

and here is a beginning of the .cc
Qt Code:
  1. #include "xmlsqlmap.h"
  2.  
  3. xmlsqlmap["PlayerID"] = "ID";
  4. xmlsqlmap["PlayerName"] = "Name";
To copy to clipboard, switch view to plain text mode 

and here a sample of the lovely errors that result.

Qt Code:
  1. xmlsqlmap.cpp:3: error: ISO C++ forbids declaration of `xmlsqlmap' with no type
  2. xmlsqlmap.cpp:3: error: size of array `xmlsqlmap' has non-integer type
  3. xmlsqlmap.cpp:3: error: conflicting types for `int xmlsqlmap[1]'
  4. xmlsqlmap.h:13: error: previous declaration as `QMap<QString, QString>
  5. xmlsqlmap'
  6. xmlsqlmap.cpp:4: error: ISO C++ forbids declaration of `xmlsqlmap' with no type
  7. xmlsqlmap.cpp:4: error: size of array `xmlsqlmap' has non-integer type
  8. xmlsqlmap.cpp:4: error: redefinition of `int xmlsqlmap[1]'
To copy to clipboard, switch view to plain text mode 

can anyone tell my why this happens, and how to fix it ?