jlblancoc / nanoflann

nanoflann: a C++11 header-only library for Nearest Neighbor (NN) search with KD-trees
Other
2.26k stars 491 forks source link

std::log2 not found #61

Closed keithbriggs closed 6 years ago

keithbriggs commented 6 years ago

kbriggs:~/tests> g++ -Wall -I ~/Downloads/nanoflann-master/include/ -I ~/Downloads/nanoflann-master/examples pointcloud_kdd_radius.cpp -o pointcloud_kdd_radius In file included from pointcloud_kdd_radius.cpp:31:0: /home/kbriggs/Downloads/nanoflann-master/include/nanoflann.hpp: In constructor ‘nanoflann::KDTreeSingleIndexDynamicAdaptor<Distance, DatasetAdaptor, DIM, IndexType>::KDTreeSingleIndexDynamicAdaptor(int, DatasetAdaptor&, const nanoflann::KDTreeSingleIndexAdaptorParams&, size_t)’: /home/kbriggs/Downloads/nanoflann-master/include/nanoflann.hpp:1825:16: error: ‘log2’ is not a member of ‘std’ treeCount = std::log2(maximumPointCount); ^ /home/kbriggs/Downloads/nanoflann-master/include/nanoflann.hpp:1825:16: note: suggested alternative: In file included from /usr/include/features.h:367:0, from /usr/include/x86_64-linux-gnu/c++/5/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:482, from /usr/include/c++/5/bits/stl_algobase.h:59, from /usr/include/c++/5/vector:60, from /home/kbriggs/Downloads/nanoflann-master/include/nanoflann.hpp:49, from pointcloud_kdd_radius.cpp:31: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:144:1: note: ‘log2’ MATHCALL (log2,, (Mdouble x)); ^

jlblancoc commented 6 years ago

Hi,

nanoflann requires C++11 to build. Add the required flags to your compiler as needed. For g++, add: -std=c++11 (or newer, C++14, etc.).

keithbriggs commented 6 years ago

Thanks, that works now.

Keith


From: Jose Luis Blanco-Claraco notifications@github.com Sent: 26 December 2017 21:03 To: jlblancoc/nanoflann Cc: Briggs,KM,Keith,TUD2 R; Author Subject: Re: [jlblancoc/nanoflann] std::log2 not found (#61)

Hi,

nanoflann requires C++11 to build. Add the required flags to your compiler as needed. For g++, add: -std=c++11 (or newer, C++14, etc.).

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/jlblancoc/nanoflann/issues/61#issuecomment-354012985, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE6IEenNYuDj4M69InZITHSNPaZ8Djxyks5tEV8fgaJpZM4RM1Lq.