I have been constructing Plugins for ImFusion for a bit now, but recently I’ve been using a different User on the same machine and while CMake builds everything fine, once I try to load the plugin in ImFusion the entire software crashes. This happens even when downloading and building the DemoPlugin from GitHub.
Using the Dev Suite, I’m able to see the message QWidget: Must construct a QApplication before a QWidget before the crash.
I have double checked all the installations, environment variables and CMake Cache and can’t seem to find a discrepancy to the working setup on the old user.
This error is somewhat disturbing, because by the point the plugins are loaded there already is a QApplication. In fact, the code loading the plugins is itself part of a QWidget.
My best guess it that something on the new user account causes it to load a wrong DLL at runtime and this version mismatch then breaks Qt. You could use the Windows Process Explorer to list the DLLs loaded by ImFusionSuite and check if any of the file paths there are suspicious.
I’m still checking out all the DLLs, but I don’t think it’s a runtime problem, as all other plugins - and these exact ones built on the other user - work flawlessly.
There has to be some kind of problem with QT during compilation that doesn’t prevent the project from building, I think.
I’ve fixed it now and the problem seems to be CMake picking up on a wrong Path of QT5 within Anaconda.
Changing the paths in the CMake Cache Editor fixed the problem.