1

Probably most of the people that has experience with Qt5 libraries will say that I should copy qwindows.dll to myappfolder/platforms/qwindows.dll.

That was already made and working flawlessly.

The problem is that I've registered the extension of my files with that app and when I double click to open a file the app crashes since it cannot find that qwindows.dll.

Desesperatly also I tried without luck this code:

QApplication::addLibraryPath(QCoreApplication::applicationDirPath());
QDir::setCurrent(QCoreApplication::applicationDirPath());
QApplication::addLibraryPath("./");
QString sDir = QCoreApplication::applicationDirPath();
QApplication::addLibraryPath(sDir);
QApplication::addLibraryPath(sDir+"/plugins/");
QApplication::addLibraryPath(sDir+"/platforms/");

But I had no luck neither.

Any tip?

As I wrote in the comments this is not the same a the deploy issue since the .exe opens fine if it gets open directly.

Frank Escobar
  • 368
  • 4
  • 20
  • Possible duplicate of [How to deploy a Qt application on Windows?](http://stackoverflow.com/questions/622418/how-to-deploy-a-qt-application-on-windows) – MrEricSir Nov 24 '15 at 19:24
  • No, as I said I can deploy it without problems I mean it opens fine if I try to open the .exe directly, the problem only happens if I associate an extension and open that file, so it could be something similar to open it using a command line. – Frank Escobar Nov 24 '15 at 19:26
  • Try to discriminate between a wrong searchpath or a plugin problem. If only qwindows.dll is a problem you might need to add a qt.conf file – adlag Dec 03 '15 at 10:58

1 Answers1

0

So I am guessing that by running it like this actually sets the application default directory where the shortcut is. You could test it by putting your shortcut/whatever file in the same directory as your .exe and see if that works.

There are ways to tell Qt loader to look elsewhere but I have never actually played with it. Look here:http://www.tripleboot.org/?p=536 And search for QT_QPA_PLATFORM_PLUGIN_PATH I think it's on about setting a system variable to your .exe location set QT_QPA_PLATFORM_PLUGIN_PATH=c:\myapp

Good luck

DannyK
  • 267
  • 2
  • 12