diff --git a/samples/c/adaptiveskindetector.cpp b/samples/c/adaptiveskindetector.cpp index a21f13e4dc..37856bd4e7 100644 --- a/samples/c/adaptiveskindetector.cpp +++ b/samples/c/adaptiveskindetector.cpp @@ -34,7 +34,6 @@ // //M*/ - #include #include #include @@ -42,6 +41,10 @@ #include "opencv2/contrib/contrib.hpp" #include "opencv2/highgui/highgui.hpp" +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + static void help(char **argv) { std::cout << "\nThis program demonstrates the contributed flesh detector CvAdaptiveSkinDetector which can be found in contrib.cpp\n" diff --git a/samples/c/blobtrack_sample.cpp b/samples/c/blobtrack_sample.cpp index e4f766cf3d..a2f3727e26 100644 --- a/samples/c/blobtrack_sample.cpp +++ b/samples/c/blobtrack_sample.cpp @@ -8,11 +8,13 @@ /* Select appropriate case insensitive string comparison function: */ #if defined WIN32 || defined _MSC_VER - #define MY_STRNICMP strnicmp - #define MY_STRICMP stricmp +# define MY_STRNICMP _strnicmp +# define MY_STRICMP _stricmp +# define MY_STRDUP _strdup #else - #define MY_STRNICMP strncasecmp - #define MY_STRICMP strcasecmp +# define MY_STRNICMP strncasecmp +# define MY_STRICMP strcasecmp +# define MY_STRDUP strdup #endif /* List of foreground (FG) DETECTION modules: */ @@ -239,7 +241,7 @@ static int RunBlobTrackingAuto( CvCapture* pCap, CvBlobTrackerAuto* pTracker,cha if(pS) { - char* pStr = strdup(pS); + char* pStr = MY_STRDUP(pS); char* pStrFree = pStr; while (pStr && strlen(pStr) > 0) diff --git a/samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp b/samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp index a3a607f1a3..fc3ac83672 100644 --- a/samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp +++ b/samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp @@ -16,6 +16,10 @@ #include "opencv2/opencv.hpp" +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + static void help(std::string errorMessage) { std::cout<<"Program init error : "< -//#include -//#include -//#include #include #include #include @@ -22,6 +18,10 @@ #include "opencv2/highgui/highgui.hpp" #include "opencv2/contrib/hybridtracker.hpp" +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + using namespace cv; using namespace std; diff --git a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp index aa4a0361d9..5cc15b3051 100644 --- a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp +++ b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp @@ -8,6 +8,10 @@ #include #include +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + using namespace cv; using namespace std;