QT Release build DLL procedure entry point error

前端 未结 4 1150
旧时难觅i
旧时难觅i 2020-12-17 10:51

I built an application in Qt Creator that does some image processing with CImg. It runs fine when I run it from the inside IDE, but if I try to launch it from its directory,

相关标签:
4条回答
  • 2020-12-17 11:12

    Had the same problem [Windows 10, Qt5 + Mingw] and got the same error even AFTER I copied all the necessary Qt5 .dll files.

    DependencyWalker crashed for me so I did trial and error method by copying files.

    It turned out that I also needed libstdc++-6.dll copied too.

    This signal that there might be additional libraries - beside the Qt ones - you need to copy.

    0 讨论(0)
  • 2020-12-17 11:13

    Even if the library version is the same they may be non compatible. For instance they were compiled with different configurations, like with or without STL support, OpenGL, SQL drivers...

    The simplest way to fix it should be to move Qt SDK's path at beginning of PATH environment variable. This way whenever you run an executable that requires Qt libraries it will load the ones shipped with SDK (the first ones found in PATH), unless there are already copies of QtCore4.dll, QtGui4.dll... in the executable's directory. For this reason if you redistribute your application you might also have to ship the libraries in its directory.

    Another option is static linking, but you will be required to provide source code under the (L)GPL licence.

    0 讨论(0)
  • 2020-12-17 11:24

    Static linking the libraries eliminates the problem.

    0 讨论(0)
  • 2020-12-17 11:28

    Use DependencyWalker to list from where qtcore4.dll is loaded. I had the same problem - DependencyWalker showed me that qtcore4.dll was loaded from c:\windows\system32 - but there was no qtcore4.dll in this folder.

    Beware: On Windows 7 64 Bit c:\windows\SysWOW64 is "mapped" as c:\windows\system32. And in this folder I found the dll - I renamed the dll and the problem was solved.

    See this answer here: Qt fresh Gui application crashes on startup, faulting at QtCore4.dll

    0 讨论(0)
提交回复
热议问题