koide3 / small_gicp

Efficient and parallel algorithms for point cloud registration [C++, Python]
MIT License
318 stars 40 forks source link

open flags build example on C++std17 C++std14 #72

Closed andy4120 closed 4 weeks ago

andy4120 commented 1 month ago

hi,there ,I 'm tring to build example by C++ ,meeting these problems ,>------ 已启动全部重新生成: 项目: 02_basic_registration_pcl, 配置: Release x64 ------ 3>Building Custom Rule D:/oursopen3d/small2GICP/small_gicp-master/small_gicp-master/CMakeLists.txt 3>02_basic_registration_pcl.cpp 3>warning: Task-based OpenMP parallelism causes run-time memory errors with Eigen matrices. 3>warning: Thus, OpenMP-based multi-threading for KdTree construction is disabled on MSVC. 3>D:\PCL\PCL 1.14.0\3rdParty\FLANN\include\flann\util\random.h(120,14): error C2039: "random_shuffle": 不是 "std" 的成员 3>(编译源文件“../src/example/02_basic_registration_pcl.cpp”) 3>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\set(22,1): 3>参见“std”的声明 3>D:\PCL\PCL 1.14.0\3rdParty\FLANN\include\flann\util\random.h(120,14): error C3861: “random_shuffle”: 找不到标识符 3>(编译源文件“../src/example/02_basic_registration_pcl.cpp”) 3>D:\PCL\PCL 1.14.0\3rdParty\FLANN\include\flann\util\lsh_table.h(367,10): error C2039: "random_shuffle": 不是 "std" 的成员 3>(编译源文件“../src/example/02_basic_registration_pcl.cpp”) 3>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\iomanip(22,1): 3>参见“std”的声明 3>D:\PCL\PCL 1.14.0\3rdParty\FLANN\include\flann\util\lsh_table.h(367,10): error C3861: “random_shuffle”: 找不到标识符 3>(编译源文件“../src/example/02_basic_registration_pcl.cpp”) 3>warning: Task-based OpenMP parallelism is not well supported on windows. 3>warning: Thus, OpenMP-based downsampling is only partially parallelized on windows. random_shuffle belong the C++14 ,but we are using the C++17 ,how to solve this,what version is your pcl

andy4120 commented 1 month ago

switching C++ standard between 17 or 14, bugs both appear

andy4120 commented 1 month ago

firstly C++17 build small-icp lib ,then another cmakelist with C++14 build examples may work ?

koide3 commented 1 month ago

It seems PCL is not (yet) compatible with C++17. Please try small_gicp::Registration instead of small_gicp::RegistrationPCL. It can be used without including the problematic FLANN in PCL.