Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Error linking against Maya 2016's Qt

Error linking against Maya 2016's Qt

Anonymous
Not applicable
579 Views
2 Replies
Message 1 of 3

Error linking against Maya 2016's Qt

Anonymous
Not applicable

Hi everyone,

 

I am trying to link against Maya's Qt.

My program is a simple main.cpp that looks like this

 

#include <QtCore/qstring.h>

int main(int argc, char **argv)
{
	QString failString;
	return 0;
}

I have both Maya 2015 and Maya 2016 installed, and am using Visual Studio 2012 Update 4.

 

In the "Developer Command Prompt for VS2012", I type

[...]\Maya2015\bin\qmake.exe -spec win32-msvc2012 -tp vc

And I get a VS2012 project that I can compile.

 

However if I run Maya2016's qmake

[...]\Maya2016\bin\qmake.exe -spec win32-msvc2012 -tp vc

 I get a VS2012 project that fails to compile, with the following linking error:

 

main.obj : error LNK2019: unresolved external symbol __imp_q_atomic_increment referenced in function main

The only difference I see between the two procedures is that Maya 2015's Qt headers were shipped with Maya, while I downloaded Maya 2016's Qt headers from the Autodesk Exchange website. Surely this cannot be the reason for the unresolved symbol, so I am really confused and am wondering if there is something obvious I am missing here?

 

Thanks a lot.

0 Likes
580 Views
2 Replies
Replies (2)
Message 2 of 3

RFlannery1
Collaborator
Collaborator

Try adding the following to the code.  (If you want to compile for both 2015 and 2016, you may have to wrap it in #ifdef MAYA2016.)

#include <Windows.h>

 

Not sure if this is the problem, but it has worked for some other plug-ins.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for your answer rflannery.

Sadly this did not help, I keep digging and will report if I get anywhere.

If anyone gets a similar issue or has anything to suggest I am a bit desperate, so any input is welcome.

0 Likes