Ask Your Question

Revision history [back]

I also had this issue when I compiled OpenCV3.3 source code for Qt. Then I found the hint here(https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows).


If you have the following error : ... windres.exe: unknown option -- W ...

try this : in cmake uncheck ENABLE_PRECOMPILED_HEADERS

If, in the file opencv/sources/modules/videoio/src/cap_dshow.cpp, you have the following error : 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope ...

try this :put the following line: #define NO_DSHOW_STRSAFE, before the line : #include "DShow.h"


Following above hints, it's OK at last.

My envirement: Whindows 7/10 64bit, Cmake 3.9.1, Qt5.9.1

I also had this issue when I compiled OpenCV3.3 source code for Qt. Then I found the hint here(https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows).


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ If you have the following error : ... windres.exe: unknown option -- W ...

try this : in cmake uncheck ENABLE_PRECOMPILED_HEADERS

If, in the file opencv/sources/modules/videoio/src/cap_dshow.cpp, you have the following error : 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope ...

try this :put the following line: #define NO_DSHOW_STRSAFE, before the line : #include "DShow.h"


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Following above hints, it's OK at last.

My envirement: Whindows 7/10 64bit, Cmake 3.9.1, Qt5.9.1