diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index 0c0b3791b2..b48c52bb58 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -78,6 +78,9 @@ endif() if (WIN32 AND HAVE_DSHOW) list(APPEND videoio_srcs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dshow.cpp) list(APPEND videoio_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/cap_dshow.hpp) + if (MINGW64) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTRSAFE_NO_DEPRECATE") + endif() endif() if (WIN32 AND HAVE_MSMF) diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index a3ece269ba..192d1730fb 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -87,6 +87,12 @@ #endif #if defined(_WIN32) || defined(_WIN64) +#if defined(__MINGW32__) +inline char *realpath(const char *path, char *resolved_path) +{ + return _fullpath(resolved_path,path,PATH_MAX); +} +#endif #define snprintf _snprintf #define vsnprintf _vsnprintf #define strcasecmp _stricmp