Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / Trying to set up plug-in dev env for Qt 4.6
  RSS 2.0 ATOM  

Trying to set up plug-in dev env for Qt 4.6
Rate this thread
 
42966
 
Permlink of this thread  
avatar
  • dythim
  • Posted: 07 May 2010 10:29 AM
  • Total Posts: 2
  • Joined: 07 May 2010 05:09 PM

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:

QT -= core \
    gui
TARGET 
myMelCmd.mll
TEMPLATE 
lib
SOURCES 
+= testqtplugin.cpp
HEADERS 
+= testqtplugin.h

DEFINES 
+= TESTQTPLUGIN_LIBRARY \
           _BOOL \
           WIN32 \
           REQUIRE_IOSTREAM
INCLUDEPATH 
+= -"C:/Program Files/Autodesk/Maya2011/include/"
LIBS += -"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[vtable for myMelCmd]+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.



Replies: 0
avatar
  • mihneab
  • Posted: 31 May 2010 09:34 PM

I don’t know if using Qt 4.6 is going to work, since Maya is using Qt 4.5.3 with some patches made by Autodesk. What I did was compile the patched Qt sources from the Maya DVD to obtain lib files (check the included howToBuildOn*.txt files), then included the headers from those sources. I used Visual Studio on Windows, I don’t know about setting it up for mingw. Building wasn’t necessary on OSX, where I linked directly with Maya.app/Contents/MacOS/QtGui and such.



Replies: 0
avatar
  • oglu
  • Posted: 31 May 2010 09:47 PM

think you have to use Qt 4.5.3
http://qt.nokia.com/qt-in-use/autodesk



http://www.linkedin.com/pub/christoph-schaedl/6/558/73b

Replies: 0
avatar
  • dythim
  • Posted: 01 June 2010 04:23 AM

Yes, you are correct. 

I figured that out a while ago (after completely giving up on these forums :P).

Thanks for the replies!



Replies: 0