Home > Blockchain >  What else does Qt5Network require when deployed?
What else does Qt5Network require when deployed?

Time:10-12

I have successfully deployed my Qt application, with all the necessary dll files, and it works fine. However, as soon as I add something which uses Qt5Network, my program crashes with "The application was unable to start correctly (0xc000007b)".

I of course copied the Qt5Network.dll to my deployment dir, and I used a dependency walker, and found out that there was one new dependency compared to what I had before adding the "network" part: libgcc_s_seh-1.dll

I copied that as well, still the same error.

I learned that Qt Network requires OpenSSL, so I found libeay32 and ssleay32, and copied them to my deployment directory as well.

The error is the same. If I remove the requirement for Qt5Network, my program runs fine, and it uses many other modules, like Printsupport, Serialport, etc. without problem.

I tried it on Qt 5.9 and 5.15.

CodePudding user response:

The official Qt binaries (Qt Network in your case) will try to load OpenSLL when first needed, at runtime, not when you first launch your application, see the SSL section here. And I believe that's the reason why dependency walker and windeployt were not able to identify OpenSSL as they can only identify load-time dependendencies.

It seems you were trying to bundle the OpenSSL binaries from an incompatible version. Starting with Qt 5.12.4 the supported OpenSSL version is 1.1.1, see for instance here. If you find the binaries from v1.1.1 and bundle those, your application should work.

  • Related