• Create Account

Qt in Maya

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

Like
0Likes
Like

Posted 03 May 2013 - 11:45 AM

Hello. Im building a Maya plugin with the QT gui library for the first time and I'm having some problems compiling. I'm using Visual Studio 2012 and Maya 2014 with included QT lib and include folder.
The problem is that I didnt found any Visual Studio project with QT only a .cpp and .h files. I tryed to use an existing Visual Studio plugin project to compile with QT and I get some errors:

1>helixQtCmd.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl HelixButton::metaObject(void)const " (?metaObject@HelixButton@@UEBAPEBUQMetaObject@@XZ)
1>helixQtCmd.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl HelixButton::qt_metacast(char const *)" (?qt_metacast@HelixButton@@UEAAPEAXPEBD@Z)
1>helixQtCmd.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl HelixButton::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@HelixButton@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)

I linked all the libraries for QT and include folders. Also I'm using the helixQtCmd.h as a HEADER FILE and not Custom Build Tool with MOC.EXE
I dont understand this moc system. I compiled the .h file with moc and it generated me another cpp file. What should I do with that cpp file? The helixQtCmd sample plugin should run with or without moc generation ?

Edited by Papadopol, 03 May 2013 - 11:45 AM.

Like
0Likes
Like

Posted 05 May 2013 - 03:24 AM

If you are using the Q_OBJECT macro (needed for defining new signals and slots), then you have to use MOC. I don't have much experiance with Qt, but this error seems to be like it's caused by missing MOC-generated code. The idea behind the MOC system is simple: it parses input files and generates some additional code, like information about classes (MOC is kind of compile time introspection system), or code of signal methods (you don't implement them yourself, it's done be MOC).

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS