From 43e855e822a4f9915d5927a781416c36990319eb Mon Sep 17 00:00:00 2001 From: matlabbe Date: Thu, 31 Jul 2014 20:59:25 +0000 Subject: [PATCH] fixed 0.5.0 build for Windows git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@358 620bd6b2-0a58-f614-fd9a-1bd335dccda9 --- CMakeLists.txt | 6 ++++-- app/main.cpp | 3 +-- console_app/main.cpp | 2 +- example/main.cpp | 2 +- include/find_object/QtOpenCV.h | 8 ++++---- include/find_object/utilite/ULogger.h | 5 +++++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28e7feee..5ccac7ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,11 @@ SET(PROJECT_PREFIX find_object) ADD_DEFINITIONS(-DPROJECT_PREFIX="${PROJECT_PREFIX}") ADD_DEFINITIONS(-DPROJECT_NAME="${PROJECT_NAME}") -IF(NOT WIN32) +IF(WIN32 AND NOT MINGW) + ADD_DEFINITIONS("-wd4251") +ELSE () ADD_DEFINITIONS( "-Wall" ) -ENDIF(NOT WIN32) +ENDIF() #ADD_DEFINITIONS("-DUNICODE") # to test with UNICODE projects ####################### diff --git a/app/main.cpp b/app/main.cpp index b4882f35..4c870cf8 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -46,8 +46,7 @@ void setupQuitSignal() #ifdef WIN32 if (!SetConsoleCtrlHandler(my_handler, TRUE)) { - printf("\nERROR: Could not set control handler"); - return 1; + UERROR("Could not set control (ctrl-c) handler"); } #else struct sigaction sigIntHandler; diff --git a/console_app/main.cpp b/console_app/main.cpp index 6c369609..1a6c808b 100644 --- a/console_app/main.cpp +++ b/console_app/main.cpp @@ -101,7 +101,7 @@ int main(int argc, char * argv[]) //////////////////////////// // Find correspondences by NNDR (Nearest Neighbor Distance Ratio) - float nndrRatio = 0.6; + float nndrRatio = 0.6f; std::vector mpts_1, mpts_2; // Used for homography std::vector indexes_1, indexes_2; // Used for homography std::vector outlier_mask; // Used for homography diff --git a/example/main.cpp b/example/main.cpp index 36ec3a5c..13125ce2 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -155,7 +155,7 @@ int main(int argc, char * argv[]) sceneWidget.setData(sceneKeypoints, cvtCvMat2QImage(sceneImg)); // Find correspondences by NNDR (Nearest Neighbor Distance Ratio) - float nndrRatio = 0.8; + float nndrRatio = 0.8f; std::vector mpts_1, mpts_2; // Used for homography std::vector indexes_1, indexes_2; // Used for homography std::vector outlier_mask; // Used for homography diff --git a/include/find_object/QtOpenCV.h b/include/find_object/QtOpenCV.h index b97c7a60..35b7158a 100644 --- a/include/find_object/QtOpenCV.h +++ b/include/find_object/QtOpenCV.h @@ -11,15 +11,15 @@ #include // Convert OpenCV matrix to QImage -QImage FINDOBJECT_EXP cvtCvMat2QImage(const cv::Mat & image, bool isBgr = true); +FINDOBJECT_EXP QImage cvtCvMat2QImage(const cv::Mat & image, bool isBgr = true); // Convert QImage to OpenCV matrix -cv::Mat FINDOBJECT_EXP cvtQImage2CvMat(const QImage & image); +FINDOBJECT_EXP cv::Mat cvtQImage2CvMat(const QImage & image); // Convert IplImage to QImage -QImage FINDOBJECT_EXP cvtIplImage2QImage(const IplImage * image); +FINDOBJECT_EXP QImage cvtIplImage2QImage(const IplImage * image); // Convert QImage to IplImage -IplImage * FINDOBJECT_EXP cvtQImage2IplImage(const QImage & image); +FINDOBJECT_EXP IplImage * cvtQImage2IplImage(const QImage & image); #endif // QTOPENCV_H diff --git a/include/find_object/utilite/ULogger.h b/include/find_object/utilite/ULogger.h index 93943d96..f9269b35 100644 --- a/include/find_object/utilite/ULogger.h +++ b/include/find_object/utilite/ULogger.h @@ -32,6 +32,11 @@ #include +#if _MSC_VER + #undef min + #undef max +#endif + /** * \file ULogger.h * \brief ULogger class and convenient macros