Message 1 of 4
Trying to set up plug-in dev env for Qt 4.6

Not applicable
05-07-2010
02:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
I have taken the auto-generated plug-in code from Visual Studio and imported it into Qt Creator, and then added in the necessary include and library files as follows:
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+0x20): undefined reference to `MPxCommand::hasSyntax() const'
collect2: ld returned 1 exit status
======================================================================================
All of the classes seem to have the same export declaration, but I'm not sure why it is failing.
Here is a quick summary of the class signatures:
Does anyone have any insight? Much appreciated.
Right now it is failing at the linking stage, saying 12 or so references are not defined.
I have taken the auto-generated plug-in code from Visual Studio and imported it into Qt Creator, and then added in the necessary include and library files as follows:
QT -= core \
gui
TARGET = myMelCmd.mll
TEMPLATE = lib
SOURCES += testqtplugin.cpp
HEADERS += testqtplugin.h
DEFINES += TESTQTPLUGIN_LIBRARY \
_BOOL \
WIN32 \
REQUIRE_IOSTREAM
INCLUDEPATH += -I "C:/Program Files/Autodesk/Maya2011/include/"
LIBS += -L "C:/Program Files/Autodesk/Maya2011/lib" \
-lOpenMaya \
-lFoundation
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+0x20): undefined reference to `MPxCommand::hasSyntax() const'
collect2: ld returned 1 exit status
======================================================================================
All of the classes seem to have the same export declaration, but I'm not sure why it is failing.
Here is a quick summary of the class signatures:
#ifndef OPENMAYA_EXPORT
#define OPENMAYA_EXPORT _declspec( dllimport )
#endif // OPENMAYA_EXPORT
class OPENMAYA_EXPORT MStatus
class OPENMAYA_EXPORT MPxCommand
class OPENMAYA_EXPORT MGlobal
class OPENMAYA_EXPORT MString
Does anyone have any insight? Much appreciated.