PCL is a relatively superior laser point cloud processing library, usually is compiled from the source code, but the compiled dynamic library in the use of the process in the header file will be reported some strange errors, at first naïve thought it is impossible to be the source of the problem, is the problem of their own environment configuration, by Sun Shi brother, suddenly understand the header file errors, The reason for the error is that part of the function has the same name as the System standard library, resulting in compiler parsing (right-to-left) errors, for example:
Errors occur in the header files: nn_index.h and result_set.h when using Kdtree and Pcl_common two DLLs, as in the following two sentences:
worst_dist_ = Std::numeric_limits::max ();size_t n = std::min (Dist_index_.size (), num_elements);This error occurs when a similar statement is compiled, and the solution is to enclose Max, Min, and so on with the preceding scopes, as follows:worst_dist_ = (std::numeric_limits::max)();size_t n = (std::min)(Dist_index_.size (), num_elements);In addition, there are similar codes in the following files that need to be modified . hierarchical_clustering_index.hkmeans_index.hlsh_table.hkdtree_index.hAutotuned_indes.hkdtree_single_index.hlsh_index.hresult_set.hnn_index.h
Bug Modification in PCL