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.

Custom Plugin Load wrong Qt DLL

Custom Plugin Load wrong Qt DLL

AtomLMW
Participant Participant
1,130 Views
8 Replies
Message 1 of 9

Custom Plugin Load wrong Qt DLL

AtomLMW
Participant
Participant

I changed the Utility Project from wizard to CMake project, and used the Qt for UI, when loading the plugin, the max.exe will load the Qt dll from my locally installed Qt directory, but not the dll in the Max folder, which will lead to an error "QWiget Must construct a QApplication before a QWidget". Are there any special settings that should be set in CMakelists to make the Max load the correct dll ?

0 Likes
1,131 Views
8 Replies
Replies (8)
Message 2 of 9

mahmutoymaci
Enthusiast
Enthusiast

Screenshot_1.png

i dont understand your problem but i solved other error like this
maybe utility for you

open yourprojectname.vcxproj.user and paste <QTDIR>Your Qt Location</QTDIR>
Not: if you are Qt version is higher then Qt5, install Qt 5.15.2 (for 3ds Max 2023 Sdk)

0 Likes
Message 3 of 9

AtomLMW
Participant
Participant

Thanks for your reply, the error is when I load the plugin there will show the error panel like this and the max will crash, the "wrong dll" means: if I use sdk wizard to gernerate project, the plugin will load the qt5dll in 3dsmax installed folder not in my additionally install qt folder. Since my project is generated by cmake there is no QTDIR varity in my project file. I am currently wondering if there should not to use cmake with 3dmax sdk developing.

内网通截图20230401174613.png

  

0 Likes
Message 4 of 9

istan
Advisor
Advisor

..and where is your plugin itself? in the max-plugins-folder?

0 Likes
Message 5 of 9

AtomLMW
Participant
Participant

stdplugin folder

0 Likes
Message 6 of 9

istan
Advisor
Advisor

@AtomLMW wrote:
max.exe will load the Qt dll from my locally installed Qt directory, but not the dll in the Max folder

@AtomLMW wrote:

the plugin will load the qt5dll in 3dsmax installed folder not in my additionally install qt folder


You contradict yourself?! Of course Max loads the qt.dll from the 3dsmax folder and your plugin has to use the same qt-version or a newer, but compatible one.

 

0 Likes
Message 7 of 9

AtomLMW
Participant
Participant

oops, my fault! What I encountered is the max would not load the dll from its installed folder but will load from my Qt lib folder (You could find the load path from the image I replied to before). The Qt version is 5.15.1 which is the same as the required one.

0 Likes
Message 8 of 9

istan
Advisor
Advisor

I'd check with "dependency walker" the DLL load paths, as normally all QT dlls will be loaded from the Max path. Nothing extra to setup..

0 Likes
Message 9 of 9

AtomLMW
Participant
Participant

Yes, that is why I guess I maight missed some thing to set in CMakeList, since the plugin project generated by cmake will load the qt dll from the Qt  folder.

0 Likes