Open KenYN opened 7 years ago
I had the same problem with PCL 1.8, MacOS and Clang 7.3.1.
I thought it was variable naming but my issue turned out to be using Flann in both a delayed load library and in my main application. The policy variable in any.h was being shared between the two and that caused problems.
As a solution I applied a patch to make the function getting the variable static so that it wouldn't be share:
--- a/src/cpp/flann/util/any.h +++ b/src/cpp/flann/util/any_fix.h @@ -138,7 +138,7 @@ SMALL_POLICY(bool);
/// This function will return a different policy for each type.
template
Thank you @MattC11 ! Your solution is perfect.
I'm using FLANN
1.9.1 on macOS Mojave with PCL
1.9.1. Compiler is Clang 10.0.0
Can't believe this bug is still there for such a long time.
I was having a mysterious runtime error in the PCL 1.7 library on Ubuntu 14.04 when compiling with
-std=c++11
(or perhaps another flag) - I was creating a point cloud and got a runtime error with what appeared to be an empty virtual table on an object of typeflann::base_any_policy
. Much debugging and hacking about later, I found that inkdtree_single_index.h
if I changed:To:
The program runs successfully.
There might have been some incompatibility between
g++
versions used, or new template resolution rules for C++11 (a colleague's Ubuntu 16.04 crashed similarly), but I think the change above should be backward-compatible.