Hello, I am trying to write a simple plugin for Maya 2011 using Qt 4.6
Right now it is failing at the linking stage, saying 12 or so references are not defined.

Here is the header file of the plugin:
Qt Code:
  1. #include <windows.h>
  2. #include <maya/MPxCommand.h>
  3. #include <maya/MGlobal.h>
  4.  
  5. class MArgList;
  6.  
  7. class myMelCmd : public MPxCommand
  8. {
  9.  
  10. public:
  11. myMelCmd();
  12. virtual ~myMelCmd();
  13.  
  14. MStatus doIt( const MArgList& );
  15. MStatus redoIt();
  16. MStatus undoIt();
  17. bool isUndoable() const;
  18.  
  19. static void* creator();
  20. };
To copy to clipboard, switch view to plain text mode 

I get errors of the following type from mingw32:
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:28: undefined reference to `_imp___ZN7MStatusC1ENS_11MStatusCodeE'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:57: undefined reference to `_imp___ZN10MPxCommand9setResultEPKc'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:59: undefined reference to `_imp___ZN7MStatusC1ENS_11MStatusCodeE'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:80: undefined reference to `_imp___ZN7MStringC1EPKc'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:80: undefined reference to `_imp___ZN7MGlobal11displayInfoERK7MString'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:80: undefined reference to `_imp___ZN7MStringD1Ev'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:82: undefined reference to `_imp___ZN7MStatusC1ENS_11MStatusCodeE'
debug/testqtplugin.o:C:\Qt\TestQtPlugin/testqtplugin.cpp:80: undefined reference to `_imp___ZN7MStringD1Ev'
debug/testqtplugin.o: In function `myMelCmd':
C:\Qt\TestQtPlugin/testqtplugin.cpp:98: undefined reference to `_imp___ZN10MPxCommandC2Ev'
C:\Qt\TestQtPlugin/testqtplugin.cpp:98: undefined reference to `_imp___ZN10MPxCommandC2Ev'
debug/testqtplugin.o: In function `~myMelCmd':
C:\Qt\TestQtPlugin/testqtplugin.cpp:111: undefined reference to `_imp___ZN10MPxCommandD2Ev'
C:\Qt\TestQtPlugin/testqtplugin.cpp:111: undefined reference to `_imp___ZN10MPxCommandD2Ev'
C:\Qt\TestQtPlugin/testqtplugin.cpp:111: undefined reference to `_imp___ZN10MPxCommandD2Ev'
debug/testqtplugin.o:testqtplugin.cpp:(.rdata$_ZTV8myMel Cmd[vtable for myMelCmd]+0x20): undefined reference to `MPxCommand::hasSyntax() const'
collect2: ld returned 1 exit status
And here are those class definitions. Each of them is underlined in red and says "unexpected token '<classname>'"
Qt Code:
  1. #ifndef OPENMAYA_EXPORT
  2. #define OPENMAYA_EXPORT _declspec( dllimport )
  3. #endif // OPENMAYA_EXPORT
  4.  
  5. class OPENMAYA_EXPORT MStatus
  6. class OPENMAYA_EXPORT MPxCommand
  7. class OPENMAYA_EXPORT MGlobal
  8. class OPENMAYA_EXPORT MString
To copy to clipboard, switch view to plain text mode 

Can anyone offer any help about what to do about this?