From 724b7194958ef3eba5638f82dcfa8f8edac97f91 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Mon, 29 Jan 2024 20:26:13 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20ROS2=20build=20error:=20"/tmp/ws/src/visp?= =?UTF-8?q?/tutorial/tracking/model-based/generic/tutorial-mb-generic-trac?= =?UTF-8?q?ker-read.cpp:193:108:=20error:=20expected=20=E2=80=98;=E2=80=99?= =?UTF-8?q?=20before=20=E2=80=98return=E2=80=99"=20Fix=20ROS2=20build=20wa?= =?UTF-8?q?rnings:=20"/tmp/ws/src/visp/tutorial/tracking/model-based/gener?= =?UTF-8?q?ic/tutorial-mb-generic-tracker-full.cpp:15:21:=20warning:=20?= =?UTF-8?q?=E2=80=98std::vector=20{anonymous}::poseToVec(const=20v?= =?UTF-8?q?pHomogeneousMatrix&)=E2=80=99=20defined=20but=20not=20used=20[-?= =?UTF-8?q?Wunused-function]"=20"/tmp/ws/src/visp/tutorial/tracking/model-?= =?UTF-8?q?based/generic/tutorial-mb-generic-tracker-read.cpp:34:14:=20war?= =?UTF-8?q?ning:=20unused=20parameter=20=E2=80=98argc=E2=80=99"=20"/tmp/ws?= =?UTF-8?q?/src/visp/modules/core/test/image-with-dataset/testColorConvers?= =?UTF-8?q?ion.cpp:955:13:=20warning:=20=E2=80=98bool=20readBinaryFile(con?= =?UTF-8?q?st=20string&,=20std::vector&)=E2=80=99=20defin?= =?UTF-8?q?ed=20but=20not=20used=20[-Wunused-function]"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/test/image-with-dataset/testColorConversion.cpp | 2 +- .../generic/tutorial-mb-generic-tracker-full.cpp | 2 ++ .../generic/tutorial-mb-generic-tracker-read.cpp | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/core/test/image-with-dataset/testColorConversion.cpp b/modules/core/test/image-with-dataset/testColorConversion.cpp index 581cabd550..bb8f721dd7 100644 --- a/modules/core/test/image-with-dataset/testColorConversion.cpp +++ b/modules/core/test/image-with-dataset/testColorConversion.cpp @@ -931,6 +931,7 @@ static double computePSNR(const vpImage &I_RGBA_8U, const vpImage= 0x030500) static bool readBinaryFile(const std::string &filename, std::vector &buffer) { std::FILE *f = std::fopen(filename.c_str(), "rb"); @@ -967,7 +968,6 @@ static bool readBinaryFile(const std::string &filename, std::vector &bu return true; } -#if (VISP_HAVE_DATASET_VERSION >= 0x030500) TEST_CASE("Bayer conversion", "[image_conversion]") { // Load original Klimt image diff --git a/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-full.cpp b/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-full.cpp index a8f8e06bd4..0bf06b6ca9 100644 --- a/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-full.cpp +++ b/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-full.cpp @@ -10,6 +10,7 @@ #include #include +#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_VIDEOIO) && defined(HAVE_OPENCV_HIGHGUI) namespace { std::vector poseToVec(const vpHomogeneousMatrix &cMo) @@ -21,6 +22,7 @@ std::vector poseToVec(const vpHomogeneousMatrix &cMo) return vec; } } +#endif int main(int argc, char **argv) { diff --git a/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-read.cpp b/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-read.cpp index 913cbd86f2..6d3c26596f 100755 --- a/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-read.cpp +++ b/tutorial/tracking/model-based/generic/tutorial-mb-generic-tracker-read.cpp @@ -6,6 +6,7 @@ #include #include +#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(HAVE_OPENCV_HIGHGUI) namespace { // https://en.cppreference.com/w/cpp/io/c/fprintf @@ -30,6 +31,7 @@ std::unique_ptr make_unique_compat(Args&&... args) #endif } } +#endif int main(int argc, char *argv[]) { @@ -190,8 +192,10 @@ int main(int argc, char *argv[]) vpDisplay::getClick(I_display, true); #else - std::cerr << "Error, a missing display library is needed (X11, GDI or OpenCV built with HighGUI module)." + (void)argc; + (void)argv; + std::cerr << "Error, a missing display library is needed (X11, GDI or OpenCV built with HighGUI module)." << std::endl; #endif - return EXIT_SUCCESS; + return EXIT_SUCCESS; }