Repository: opencv
Issue: compile a cap_dshow.cpp in the mingw
Labels: priority: low,category: videoio,category: build/install,incomplete,needs investigation

Hi, 
I've got an error by compiling with a branch of opencv 3.4.7.
##### Error 
```
opencv-3.4.7\modules\videoio\src\cap_dshow.cpp:2313:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
```
##### System information
OS: windows 10.
gcc version(mingw32):
`
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/DEV/SDK/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-9.1.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --enable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 9.1.0 (Rev3, Built by MSYS2 project)
`

> So, I changed all sprintf to sprintf_s without any error.
Is there any point that i missed?

Here is my configure log:
```
======================================
Detected processor: AMD64
sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-3.4.7-libjpeg-turbo
Found TBB (env): C:/DEV/SDK/msys64/mingw32/lib/libtbb.dll.a
Found OpenBLAS libraries: C:/DEV/SDK/msys64/mingw32/lib/libopenblas.a
Found OpenBLAS include: C:/DEV/SDK/msys64/mingw32/include/OpenBLAS
LAPACK(OpenBLAS): LAPACK_LIBRARIES: C:/DEV/SDK/msys64/mingw32/lib/libopenblas.a
LAPACK(OpenBLAS): Can't build LAPACK check code. This LAPACK version is not supported.
A library with LAPACK API found.
LAPACK(LAPACK/Generic): LAPACK_LIBRARIES: C:/DEV/SDK/msys64/mingw32/lib/libopenblas.a
LAPACK(LAPACK/Generic): Can't build LAPACK check code. This LAPACK version is not supported.
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
Found apache ant: C:/DEV/Tools/apache-ant-1.9.14/bin/ant.bat (1.9.14)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
OpenCV Python: during development append to PYTHONPATH: C:/DEV/SDK/opencv-3.4.7/build/opencv_build/python_loader
Caffe:   NO
Protobuf:   NO
Glog:   YES
freetype2:   NO
harfbuzz:    NO
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Found installed version of gflags: C:/DEV/SDK/msys64/mingw32/lib/cmake/gflags
Detected gflags version: 2.2.2
Found installed version of Eigen: C:/DEV/SDK/msys64/mingw32/share/eigen3/cmake
Found required Ceres dependency: Eigen version 3.3.7 in C:/DEV/SDK/msys64/mingw32/include/eigen3
Found installed version of glog: C:/DEV/SDK/msys64/mingw32/lib/cmake/glog
Detected glog version: 0.4.0
Found required Ceres dependency: glog
Found installed version of gflags: C:/DEV/SDK/msys64/mingw32/lib/cmake/gflags
Detected gflags version: 2.2.2
Found required Ceres dependency: gflags
Found Ceres version: 1.14.0 installed in: C:/DEV/SDK/msys64/mingw32 with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
Checking SFM deps... FALSE
Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags
Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
Excluding from source files list: modules/imgproc/src/sumpixels.avx512_skx.cpp
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx2.cpp
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
Excluding from source files list: modules/features2d/src/fast.avx2.cpp
Tesseract:   YES
General configuration for OpenCV 3.4.7 =====================================
  Version control:               unknown
  Extra modules:
    Location (extra):            C:/DEV/SDK/opencv-3.4.7/opencv_contrib-cleanup_stl_string_replacement/modules
    Version control (extra):     unknown
  Platform:
    Timestamp:                   2019-08-07T15:02:29Z
    Host:                        Windows 10.0.17134 AMD64
    CMake:                       3.15.1
    CMake generator:             MinGW Makefiles
    CMake build tool:            C:/DEV/SDK/msys64/mingw32/bin/mingw32-make.exe
    Configuration:               Release
  CPU/HW features:
    Baseline:                    SSE SSE2
      requested:                 SSE2
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX
      requested:                 SSE4_1 SSE4_2 AVX FP16
      SSE4_1 (12 files):         + SSE3 SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (5 files):             + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX
  C/C++:
    Built as dynamic libs?:      YES
    C++11:                       YES
    C++ Compiler:                C:/DEV/SDK/msys64/mingw32/bin/i686-w64-mingw32-g++.exe  (ver 9.1.0)
    C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  C:/DEV/SDK/msys64/mingw32/bin/i686-w64-mingw32-gcc.exe
    C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -mfpmath=sse -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--gc-sections  
    Linker flags (Debug):        -Wl,--gc-sections  
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:
    3rdparty dependencies:
  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dpm face features2d flann fuzzy hdf hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow ovis phase_unwrapping photo plot reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype js matlab python2 python3 sfm viz
    Applications:                apps
    Documentation:               NO
    Non-free algorithms:         NO
  Windows RT support:            NO
  GUI: 
    Win32 UI:                    YES
    VTK support:                 NO
  Media I/O: 
    ZLib:                        build (ver 1.2.11)
    JPEG:                        build-libjpeg-turbo (ver 2.0.2-62)
    WEBP:                        build (ver encoder: 0x020e)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.0.10)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (ver 57.107.100)
      avformat:                  YES (ver 57.83.100)
      avutil:                    YES (ver 55.78.100)
      swscale:                   YES (ver 4.8.100)
      avresample:                YES (ver 3.7.0)
    GStreamer:                   NO
    DirectShow:                  YES
  Parallel framework:            TBB (ver 2019.0 interface 11001)
  Trace:                         YES (built-in)
  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       YES (ver 3.3.7)
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)
  OpenCL:                        YES (no extra features)
    Include path:                C:/DEV/SDK/opencv-3.4.7/opencv-3.4.7/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load
  Python (for build):            C:/DEV/SDK/msys64/mingw32/bin/python2.7.exe
  Java:                          
    ant:                         C:/DEV/Tools/apache-ant-1.9.14/bin/ant.bat (ver 1.9.14)
    JNI:                         C:/DEV/SDK/jdk-8u999-windows-i586/jdk1.8.0_999/include C:/DEV/SDK/jdk-8u999-windows-i586/jdk1.8.0_999/include/win32 C:/DEV/SDK/jdk-8u999-windows-i586/jdk1.8.0_999/include
    Java wrappers:               YES
    Java tests:                  NO
  Install to:                    C:/DEV/SDK/opencv-3.4.7/build/opencv_build/install
-----------------------------------------------------------------

Configuring done
```