OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.87k stars 652 forks source link

Fix errors with recent compilers and C++17/20 standard #394

Closed SpaceIm closed 1 year ago

SpaceIm commented 1 year ago

octomap fails to compile with recent compilers when I enable C++20 standard:

gcc12/C++20 ``` octomap/1.9.7: Building from source octomap/1.9.7: Package octomap/1.9.7:e9554f9728649ff86b11b47e22e41252ff0c68eb octomap/1.9.7: Copying sources to build folder octomap/1.9.7: Building your package in /home/spaceim/.conan2/p/t/octom737ff965347f3/b octomap/1.9.7: Calling generate() octomap/1.9.7: Generators folder: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/build/Release/generators octomap/1.9.7: CMakeToolchain generated: conan_toolchain.cmake octomap/1.9.7: CMakeToolchain generated: CMakePresets.json octomap/1.9.7: CMakeToolchain generated: ../../../src/CMakeUserPresets.json octomap/1.9.7: Generating aggregated env files octomap/1.9.7: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] octomap/1.9.7: Calling build() octomap/1.9.7: Running CMake.configure() octomap/1.9.7: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="/home/spaceim/.conan2/p/t/octom737ff965347f3/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/spaceim/.conan2/p/t/octom737ff965347f3/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap" -- Using Conan toolchain: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/build/Release/generators/conan_toolchain.cmake -- Conan toolchain: C++ Standard 20 with extensions OFF -- Conan toolchain: Setting BUILD_SHARED_LIBS = ON -- The C compiler identification is GNU 12.1.0 -- The CXX compiler identification is GNU 12.1.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/gcc-12 - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++-12 - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- octomap building as Release -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Compile octomap using: make -- Install octomap using: make install -- (be sure to set the correct CMAKE_INSTALL_PREFIX before) -- Compile API-documentation using: make docs -- Configuring done (7.2s) -- Generating done (0.0s) -- Build files have been written to: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/build/Release octomap/1.9.7: Running CMake.build() octomap/1.9.7: RUN: cmake --build "/home/spaceim/.conan2/p/t/octom737ff965347f3/b/build/Release" -- -j8 [4/16] Building CXX object src/CMakeFiles/octomap.dir/CountingOcTree.cpp.o FAILED: src/CMakeFiles/octomap.dir/CountingOcTree.cpp.o /usr/bin/g++-12 -Doctomap_EXPORTS -I/home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include -m64 -Wall -Wextra -Wpedantic -O3 -funroll-loops -DNDEBUG -std=c++20 -fPIC -MD -MT src/CMakeFiles/octomap.dir/CountingOcTree.cpp.o -MF src/CMakeFiles/octomap.dir/CountingOcTree.cpp.o.d -o src/CMakeFiles/octomap.dir/CountingOcTree.cpp.o -c /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/CountingOcTree.cpp In file included from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBaseImpl.h:83, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:38, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/CountingOcTree.h:39, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/CountingOcTree.cpp:35: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeIterator.hxx:42:39: warning: ‘template struct std::iterator’ is deprecated [-Wdeprecated-declarations] 42 | class iterator_base : public std::iterator{ | ^~~~~~~~ In file included from /usr/include/c++/12/bits/stl_algobase.h:65, from /usr/include/c++/12/list:60, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBaseImpl.h:38: /usr/include/c++/12/bits/stl_iterator_base_types.h:127:34: note: declared here 127 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:46:22: error: expected unqualified-id before ‘double’ 46 | OcTreeBase(double res) : OcTreeBaseImpl(res) {}; | ^~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:46:22: error: expected ‘)’ before ‘double’ 46 | OcTreeBase(double res) : OcTreeBaseImpl(res) {}; | ~^~~~~~ | ) /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/CountingOcTree.cpp: In constructor ‘octomap::CountingOcTree::CountingOcTree(double)’: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/CountingOcTree.cpp:53:50: error: no matching function for call to ‘octomap::OcTreeBase::OcTreeBase(double&)’ 53 | : OcTreeBase(in_resolution) { | ^ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: candidate: ‘octomap::OcTreeBase::OcTreeBase(const octomap::OcTreeBase&)’ 44 | class OcTreeBase : public OcTreeBaseImpl { | ^~~~~~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: no known conversion for argument 1 from ‘double’ to ‘const octomap::OcTreeBase&’ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: candidate: ‘octomap::OcTreeBase::OcTreeBase(octomap::OcTreeBase&&)’ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: no known conversion for argument 1 from ‘double’ to ‘octomap::OcTreeBase&&’ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h: In instantiation of ‘octomap::OcTreeBase* octomap::OcTreeBase::create() const [with NODE = octomap::CountingOcTreeNode]’: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:50:23: required from here /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:50:46: error: no matching function for call to ‘octomap::OcTreeBase::OcTreeBase(const double&)’ 50 | OcTreeBase* create() const {return new OcTreeBase(this->resolution); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: candidate: ‘octomap::OcTreeBase::OcTreeBase(const octomap::OcTreeBase&)’ 44 | class OcTreeBase : public OcTreeBaseImpl { | ^~~~~~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: no known conversion for argument 1 from ‘const double’ to ‘const octomap::OcTreeBase&’ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: candidate: ‘octomap::OcTreeBase::OcTreeBase(octomap::OcTreeBase&&)’ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:44:9: note: no known conversion for argument 1 from ‘const double’ to ‘octomap::OcTreeBase&&’ [6/16] Building CXX object src/CMakeFiles/octomap.dir/AbstractOcTree.cpp.o FAILED: src/CMakeFiles/octomap.dir/AbstractOcTree.cpp.o /usr/bin/g++-12 -Doctomap_EXPORTS -I/home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include -m64 -Wall -Wextra -Wpedantic -O3 -funroll-loops -DNDEBUG -std=c++20 -fPIC -MD -MT src/CMakeFiles/octomap.dir/AbstractOcTree.cpp.o -MF src/CMakeFiles/octomap.dir/AbstractOcTree.cpp.o.d -o src/CMakeFiles/octomap.dir/AbstractOcTree.cpp.o -c /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/AbstractOcTree.cpp In file included from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBaseImpl.h:83, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OccupancyOcTreeBase.h:44, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTree.h:38, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/AbstractOcTree.cpp:36: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeIterator.hxx:42:39: warning: ‘template struct std::iterator’ is deprecated [-Wdeprecated-declarations] 42 | class iterator_base : public std::iterator{ | ^~~~~~~~ In file included from /usr/include/c++/12/bits/stl_construct.h:61, from /usr/include/c++/12/bits/char_traits.h:46, from /usr/include/c++/12/ios:40, from /usr/include/c++/12/istream:38, from /usr/include/c++/12/fstream:38, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/AbstractOcTree.h:38, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/AbstractOcTree.cpp:35: /usr/include/c++/12/bits/stl_iterator_base_types.h:127:34: note: declared here 127 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~ In file included from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/CountingOcTree.h:39, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/AbstractOcTree.cpp:37: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:46:22: error: expected unqualified-id before ‘double’ 46 | OcTreeBase(double res) : OcTreeBaseImpl(res) {}; | ^~~~~~ /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBase.h:46:22: error: expected ‘)’ before ‘double’ 46 | OcTreeBase(double res) : OcTreeBaseImpl(res) {}; | ~^~~~~~ | ) [11/16] Building CXX object src/CMakeFiles/octomap.dir/OcTree.cpp.o In file included from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeBaseImpl.h:83, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OccupancyOcTreeBase.h:44, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTree.h:38, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/src/OcTree.cpp:34: /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OcTreeIterator.hxx:42:39: warning: ‘template struct std::iterator’ is deprecated [-Wdeprecated-declarations] 42 | class iterator_base : public std::iterator{ | ^~~~~~~~ In file included from /usr/include/c++/12/bits/stl_algobase.h:65, from /usr/include/c++/12/list:60, from /home/spaceim/.conan2/p/t/octom737ff965347f3/b/src/octomap/include/octomap/OccupancyOcTreeBase.h:38: /usr/include/c++/12/bits/stl_iterator_base_types.h:127:34: note: declared here 127 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~ ninja: build stopped: subcommand failed. octomap/1.9.7: ERROR: Package 'e9554f9728649ff86b11b47e22e41252ff0c68eb' build failed ```
Visual Studio 2022/C++20 ``` octomap/1.9.7: Building from source octomap/1.9.7: Package octomap/1.9.7:e650b83588a2400c6b6d90a4d87990196c53536a octomap/1.9.7: Copying sources to build folder octomap/1.9.7: Building your package in C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b octomap/1.9.7: Calling generate() octomap/1.9.7: Generators folder: C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\build\Release\generators octomap/1.9.7: CMakeToolchain generated: conan_toolchain.cmake octomap/1.9.7: CMakeToolchain generated: CMakePresets.json octomap/1.9.7: CMakeToolchain generated: ..\..\..\src\CMakeUserPresets.json octomap/1.9.7: Generating aggregated env files octomap/1.9.7: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat'] octomap/1.9.7: Calling build() octomap/1.9.7: Running CMake.configure() octomap/1.9.7: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:/Users/spaceim/.conan2/p/t/octomd42ddb0f4438d/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/spaceim/.conan2/p/t/octomd42ddb0f4438d/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap" conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - vcvars_ver=14.3 [vcvarsall.bat] Environment initialized for: 'x64' -- Using Conan toolchain: C:/Users/spaceim/.conan2/p/t/octomd42ddb0f4438d/b/build/Release/generators/conan_toolchain.cmake -- Conan toolchain: C++ Standard 20 with extensions OFF -- Conan toolchain: Setting BUILD_SHARED_LIBS = ON -- The C compiler identification is MSVC 19.35.32217.1 -- The CXX compiler identification is MSVC 19.35.32217.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- octomap building as Release -- Found Doxygen: D:/Programmes/mingw64/bin/doxygen.exe (found version "1.9.5") found components: doxygen missing components: dot -- Compile octomap using: make -- Install octomap using: make install -- (be sure to set the correct CMAKE_INSTALL_PREFIX before) -- Compile API-documentation using: make docs -- Configuring done (1.6s) -- Generating done (0.0s) -- Build files have been written to: C:/Users/spaceim/.conan2/p/t/octomd42ddb0f4438d/b/build/Release octomap/1.9.7: Running CMake.build() octomap/1.9.7: RUN: cmake --build "C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\build\Release" -- -j8 conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - vcvars_ver=14.3 [vcvarsall.bat] Environment initialized for: 'x64' [1/14] Building CXX object src\CMakeFiles\octomap.dir\Pointcloud.cpp.obj FAILED: src/CMakeFiles/octomap.dir/Pointcloud.cpp.obj C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe /nologo /TP -Doctomap_EXPORTS -IC:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /O2 /Ob2 /DNDEBUG -std:c++20 -MD /showIncludes /Fosrc\CMakeFiles\octomap.dir\Pointcloud.cpp.obj /Fdsrc\CMakeFiles\octomap.dir\ /FS -c C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\src\Pointcloud.cpp C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\ciso646(15): warning C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning. C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\src\Pointcloud.cpp(221): error C2039: 'random_shuffle': is not a member of 'std' C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\iostream(19): note: see declaration of 'std' C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\src\Pointcloud.cpp(221): error C3861: 'random_shuffle': identifier not found [5/14] Building CXX object src\CMakeFiles\octomap.dir\AbstractOccupancyOcTree.cpp.obj C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\ciso646(15): warning C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning. [7/14] Building CXX object src\CMakeFiles\octomap.dir\CountingOcTree.cpp.obj C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\ciso646(15): warning C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning. C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(42): warning C4996: 'std::iterator': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning. C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6802): note: see declaration of 'std::iterator' C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(263): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::iterator_base' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OcTreeBaseImpl.h(564): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::leaf_iterator' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OcTreeBase.h(44): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/CountingOcTree.h(76): note: see reference to class template instantiation 'octomap::OcTreeBase' being compiled [8/14] Building CXX object src\CMakeFiles\octomap.dir\AbstractOcTree.cpp.obj C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\ciso646(15): warning C4996: '_Header_ciso646': warning STL4036: is removed in C++20. You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to suppress this warning. C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(42): warning C4996: 'std::iterator': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning. C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6802): note: see declaration of 'std::iterator' C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(263): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::iterator_base' being compiled with [ NODE=octomap::OcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OcTreeBaseImpl.h(564): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::leaf_iterator' being compiled with [ NODE=octomap::OcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OccupancyOcTreeBase.h(69): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl' being compiled with [ NODE=octomap::OcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTree.h(49): note: see reference to class template instantiation 'octomap::OccupancyOcTreeBase' being compiled C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(42): warning C4996: 'std::iterator': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning. C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6802): note: see declaration of 'std::iterator' C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/OcTreeIterator.hxx(263): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::iterator_base' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OcTreeBaseImpl.h(564): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl::leaf_iterator' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap\OcTreeBase.h(44): note: see reference to class template instantiation 'octomap::OcTreeBaseImpl' being compiled with [ NODE=octomap::CountingOcTreeNode ] C:\Users\spaceim\.conan2\p\t\octomd42ddb0f4438d\b\src\octomap\include\octomap/CountingOcTree.h(76): note: see reference to class template instantiation 'octomap::OcTreeBase' being compiled ninja: build stopped: subcommand failed. octomap/1.9.7: ERROR: Package 'e650b83588a2400c6b6d90a4d87990196c53536a' build failed ```

This PR fixes most obvious illformed syntax or logic:

ahornung commented 1 year ago

Thanks for your contribution! I think there are some general issues with the ROS CI setup, looks fine to merge.

eladm-ultrawis commented 1 year ago

@ahornung is there a chance to submit a patch to the vcpkg port? the current version fails to build on latest MSVC.

ahornung commented 1 year ago

@eladm-ultrawis: sure, is there something I can accept as a PR here that needs to be changed?

Not sure what you exactly mean, because I'm not maintaining the vcpkg port.

eladm-ultrawis commented 1 year ago

@ahornung I see, I thought you are the maintainer. I have no idea who maintains it then.