When I download and installed latest opencv (4.5.3) for windows, I have problem with my C++ code.
It cannot run cv.imshow(). The error is shown in the picture:
I wonder if the opencv was compiled with GTK or something.
Do I have to install GTK library? I used to use another version opencv dlls built by my co-worker for 32bit and I have no such issue.
Thank you in advance!
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\highgui\src\registry.impl.hpp (114) cv::highgui_backend::UIBackendRegistry::UIBackendRegistry UI: Enabled backends(4, sorted by priority): GTK(1000); GTK3(990); GTK2(980); WIN32(970) + BUILTIN(WIN32UI)
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load C:\LiuJun\Code\C\SUW1\x64\Debug\opencv_highgui_gtk453_64.dll => FAILED
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load opencv_highgui_gtk453_64.dll => FAILED
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load C:\LiuJun\Code\C\SUW1\x64\Debug\opencv_highgui_gtk3453_64.dll => FAILED
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load opencv_highgui_gtk3453_64.dll => FAILED
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load C:\LiuJun\Code\C\SUW1\x64\Debug\opencv_highgui_gtk2453_64.dll => FAILED
[ INFO:0] global c:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::libraryLoad load opencv_highgui_gtk2453_64.dll => FAILED
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\highgui\src\backend.cpp (90) cv::highgui_backend::createUIBackend UI: using backend: WIN32 (priority=970)
[ INFO:0] global C:\build\master_winpack-build-win64-vc15\opencv\modules\highgui\src\window_w32.cpp (3009) cv::impl::Win32BackendUI::createWindow OpenCV/UI: Creating Win32UI window: out (1)
you really can’t ? (hard to believe…)
there is no error here at all, only INFO messages
(it tries to load some plugins, that do not exist on your machine)
there wont be any such messages in RELEASE mode
no.
however, if you would have a gtk (or qt) based highgui plugin dll, you could choose that as backend at runtime
Well, I tried to show a number of images (with a loop), and only the first one was displayed.
Maybe you are correct that the first imshow() runs, but the following imshow() cannot run.
This whole screen of messages comes up after the first imshow() pops up and no more imshow() can be run.
This behavior is very different from the 32bit library.
I understand that waitKey(0) will block until I press the key.
But only in case of Debug/x64, there is no the 2nd imshow(), instead it will exit with error code:
In fact it throw except:
Exception thrown at 0x00007FFC380E5A26 (opencv_world453d.dll) in SUW1.exe: 0xC0000005: Access violation reading location 0x0000000000000010.
However for release/x64, there is no problem.
For 32bit there is no problem for both debug and release dll.
I am sure it is not a bug in my code, but I suspect there is a need to set some flag etc in Debug/x64
which VS version do you use ? (is vc15 the right lib folder ?)
and your coworker ? the 32bit libs were obviously locally built.
can you try to build from src, too ?
I use VS2019, version 16.10.4. and use vc15.
The Platform toolset in VS is Visual Studio 2019 (V142)
We want to use a clean and new laptop to install VS 2019 and the latest OpenCV to see if these are sufficient to start the programming in C++ with OpenCV
I only installed these 2 days ago. And I did not install anything else except python Opencv 3.7 which is working perfectly.
My old laptop has multiple OpenCV libraries, some are locally built, some are downloaded from release 3.5 onwards.
We never experienced such inconsistencies between Debug and Release versions.
I am thinking to build a local opencv or download an old version to see if there is a problem.
I build both debug and release version of OpenCV, using my VS2019.
I have the exact result as I use the dlls downloaded.
For release version, it can run the second imshow() without problem.
For debug version, it shows the first image, but with a lot of “info” and then exit with error code.
Since this debug info is an option, I will try to unchecked it and build a debug version soon.
Hi,
I’m running openCV 4.5.5, vs2017, VC15, and face the exact same behaviour. Images run properly when building vs2017, but in vs2017_debug I get only first image. @qceptliujun did you move forward on this topic ?
Thanks