Trouble building a FULL version of OpenCV (C++) with open source QT5

I have been trying to build a full version of OpenCV for C++/Windows/x86_64, that includes QT5 (open source) integration. (I want to use it to help me test some embedded software that I developed.) It has been a real headache!

It took me a while just to find the required sequence of dependencies and commands to get OpenCV to build without errors. I then found that in order to use the video frame rendering capabilities of OpenCV, I would need to create a C++ library build that included QT5. In order to do that, I needed to do a full build of the QT5 open source (for C++/Windows/x86_64). That turned out to be an even bigger headache. I finally have everything building, but now when I try to load one of my DLLs that are linked to OpenCV/QT5, the DLL fails to load. I have not yet figured out why.

Does anyone have any thoughts as to why?

what would those be, specifically?

OpenCV needs no Qt for its GUI. it can use it, but by default it simply uses native Windows APIs.

The official binary release for Windows x86-64 should be just fine for you to use.

Is that so? Does Qt not offer a binary release of its library for Visual Studio that you can use?

all kinds of stuff has to be findable by LoadLibrary(). that includes all the Qt stuff (if you linked to it). since LoadLibrary() isn’t talkative at all, you’d have to exclude various OpenCV modules from the build process, rebuild, and see if that did it. yes, trial and error. or experienced operation of some dependency walker tool (these days, “Dependencies”, open source on github).

Yes, it seems to be relates to dependent DLLs not loading.

I was able to make it a little further in the debug process.
I copied the following QT5 DLLs to the binary execution folder: Qt5Widgetsd.dll, Qt5Guid.dll, Qt5Cored.dll
I also copied the following Intel TDD DLL to the binary execution folder: tbb12_debug.dll

I am now getting the following error when I try to execute my code:
initButton@qpushbutton not found in dynamic link library: opencv_highgui4100d.dll

I ran Dependency Walker. I have attached a link to the text file with the output log.

VideoOcvScrnOutput.txt

all those DLLs are debug builds (d suffix).

if your program wanted those types, that means you built your own program as a debug build.

that also means you have to have (Qt), or to build (OpenCV), those dependencies as debug builds.

or switch your own program to a release build and have all the dependencies as release builds too.

official opencv binary releases have both debug and release binaries, but IDK about Qt.

your attached output is quite extensive. that’s why I said these tools need some experience. my experience is limited to recognizing that a lot of these lines are due to probing of what DLLs are available. most of these aren’t, which is okay. it’s very hard to figure out which these are actually required. you could remove all the lines involving those MS-THIS-THAT-SOMETHING lines. then the picture might get clearer.

Yes, Dlls are debug.
Yes, my application is a debug build.
Yes, I was using a debug build of QT.

I have continued to investigate this issue. After some effort spent in the debugger, I found that the dependent DLL that is failing to load is the “opencv_highgui4100d.dll“ library. I think this may be due to a problem loading a QT5 dependent DLL. (See attached photo for the error message from the VC debugger.) Note that ALL QT5 DLLs (and OpenCV DLLs) are in the application search path.

The error that I see from the “opencv_highgui4100d.dll“ module in the debugger is “hitButton@QPushButton not found”.

Anyone have any idea why this might be occuring???