From a7a94cc33604729295930d61fea3489166bf60ec Mon Sep 17 00:00:00 2001 From: Spiwocoal Date: Wed, 22 Sep 2021 23:28:22 -0300 Subject: [PATCH] Fix Streamer/Recorder build errors Streamer/Recorder toolbox was failing at build because since GCC 11, the default C++ standard is C++17, which does not allow dynamic exception specifications anymore. This was resolved by changing the C++ standard used to build the ProtonectSR target to C++14, though I suppose the ideal solution would be to simply not use dynamic exception specifications anymore. There was also the problem that the files `recorder.cpp` and `streamer.cpp` referenced `CV_IMWRITE_JPEG_QUALITY` when, at least according to what I could find, doesn't exist and should be `cv::IMWRITE_JPEG_QUALITY`. Resolves: #1155 --- tools/streamer_recorder/CMakeLists.txt | 4 ++++ tools/streamer_recorder/recorder.cpp | 2 +- tools/streamer_recorder/streamer.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/streamer_recorder/CMakeLists.txt b/tools/streamer_recorder/CMakeLists.txt index 77f203f5e..9b9a265ac 100644 --- a/tools/streamer_recorder/CMakeLists.txt +++ b/tools/streamer_recorder/CMakeLists.txt @@ -94,6 +94,10 @@ ADD_EXECUTABLE(ProtonectSR ${ProtonectSR_src} ) +SET_TARGET_PROPERTIES(ProtonectSR PROPERTIES + CXX_STANDARD 14 +) + TARGET_LINK_LIBRARIES(ProtonectSR ${ProtonectSR_LIBRARIES} ) diff --git a/tools/streamer_recorder/recorder.cpp b/tools/streamer_recorder/recorder.cpp index 89afc3972..d080f30d1 100644 --- a/tools/streamer_recorder/recorder.cpp +++ b/tools/streamer_recorder/recorder.cpp @@ -78,7 +78,7 @@ void Recorder::initialize() ///////////////////////////////////////////////////////////////// // record image: define compression parameters and frame counter - img_comp_param.push_back(CV_IMWRITE_JPEG_QUALITY); //specify the compression technique + img_comp_param.push_back(cv::IMWRITE_JPEG_QUALITY); //specify the compression technique img_comp_param.push_back(100); //specify the compression quality frameID = 0; diff --git a/tools/streamer_recorder/streamer.cpp b/tools/streamer_recorder/streamer.cpp index 9cd03333b..a81b5235b 100644 --- a/tools/streamer_recorder/streamer.cpp +++ b/tools/streamer_recorder/streamer.cpp @@ -36,7 +36,7 @@ void Streamer::initialize() servAddress = SERVER_ADDRESS; servPort = Socket::resolveService(SERVER_PORT, "udp"); // Server port - compression_params.push_back(CV_IMWRITE_JPEG_QUALITY); + compression_params.push_back(cv::IMWRITE_JPEG_QUALITY); compression_params.push_back(jpegqual); }