Compiling in VS2005 and XCode

Lindley M French lfrench1 at gmu.edu
Mon May 4 22:54:42 UTC 2009


I have libkdtree++ 0.6.2. I've been using it for a graduate class project, and it's offered a large speed improvement over the search methods I tried on my own.

I had difficulty getting it to build both on XCode (at home) and Visual Studio 2005 (school). On XCode I got it working following a suggestion I found online to comment as the following:
typedef _Node/*<_Val>*/* _Link_type;
typedef _Node/*<_Val>*/ const* _Link_const_type;
It now builds cleanly on XCode.

However, VS still isn't working. The errors I'm getting seem to be related to find_within_range:
kdtree.hpp(374) : error C2561: 'KDTree::KDTree<__K,_Val,_Acc>::find_within_range' : function must return a value
kdtree.hpp(376) : error C2059: syntax error : ')'

Now, since this is a template, it's possible the issue is related to my usage of the function, so that's here:
kdtree.find_within_range(-1, maxdist, std::back_inserter(indexes_out));

Rather than storing actual values within the KDTree, I'm simply storing indexes which are interpreted by the bracket-lookup class. -1 is a special index representing the current query point. indexes_out is thus a std::vector<int>, and the KDTree itself is declared as KDTree::KDTree<3, int, DimIndex> where DimIndex is my index-to-feature functor.

Any quick-fix for this issue available? I'll note again that the above all compiles cleanly in XCode, so it's probably not an egregious error but some minor bit of syntax somewhere that VS is choking on.



More information about the libkdtree-devel mailing list