QT Release build DLL procedure entry point error

与世无争的帅哥 提交于 2019-12-18 04:35:07

问题


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, it throws the following error.

The procedure entry point ??4QString@@QAEAAV0@$$QAV0AAZ could not be located 
in the dynamic link library QtCore4.dll

Everything points to having multiple version of the DLLs installed. I found my Xilinx IDE uses the Qt libraries, but the DLLs in question are the same version. I'm not really a software guy, and at a loss here.


回答1:


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.




回答2:


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




回答3:


Static linking the libraries eliminates the problem.




回答4:


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.



来源:https://stackoverflow.com/questions/11694140/qt-release-build-dll-procedure-entry-point-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!