1

I have a program made in QtCreator that works on both Linux and Windows. The program uses Qt, OpenCV on other Open source library (which is not the problem here.) My problem is that QImage has some unresolved problems when I try to run my exe without the IDE.

**For the context of this question, the exe with the problem will be called 'project.exe'

I've tried to put both project.exe Qt5Gui.dll (Because QImage is in there) in Dependenciy Walker. And to my suprise, project.exe was missing the exact same function of the error in the title. BUT, for Qt5Gui.dll, the same function was NOT missing from the DLL.

Here is what I have for Qt to include and use in the .pro file

QT += core gui

The plan here is to have a working application without the IDE (Qt Creator) on Windows. In order to do so, I did these exact steps for numerous other Qt apps in the past. Here is a batch script:

mkdir build
cd build

call "%path_to_visual_studio%\VC\Auxiliary\Build\vcvarsall.bat" x64
call "%path_to_qt%\msvc2017_64\bin\qmake.exe" path\to\project.pro -spec win32-msvc "CONFIG+=qtquickcompiler" && "%path_to_qt%\Tools\QtCreator\bin\jom.exe"  -f Makefile.Release
call "%path_to_qt%\msvc2017_64\bin\windeployqt.exe" project.exe

After this is done, Qt's windeployqt.exe has added all the necessary of Qt and I then add my opencv DLLs and at this point, everything is OK. But when I try to run the project.exe that is when I get the ERROR:

The procedure entry point
??0QImage@@QEAA@$$QEAV0@@Z could not be located in the dynamic link library
C:\Path\to\project.exe

Thanks for the help!

Hugov
  • 21
  • 5

2 Answers2

1

The problem may be caused by different Qt dlls - built with different compilers. Use ProcessExplorer (procexp.exe ) or similar program to see, what exact Qt5Gui.dll from which folders uses your app when launched from inside the IDE. Then use search everything (voidtools) to find dlls with similar name. Rename that other folder and try to launch/build again.

1

I compiled it with the same exact script on another windows box with the same configurations and it worked on that one...

I think it is safe to assume that the problem was my Qt installation.

Hugov
  • 21
  • 5