Binary package hint: libkdtree++-dev
libkdtree++-dev produces compilation erros with recent versions of g++, like 4.0. Version 3.4 works fine, though. Here is my compiler output:
g++ -c -Wall -Wno-deprecated -g -DDEBUG -Iinclude -I/usr/include/GL//include -I/usr/include/GL/ src/main.cpp -o obj/debug/main.o
/usr/include/kdtree++/kdtree.hpp:36: error: ‘KDTree’ is not a type
/usr/include/kdtree++/kdtree.hpp:36: error: expected ‘,’ or ‘...’ before ‘<’ token
/usr/include/kdtree++/kdtree.hpp: In function ‘std::ostream& KDTree::operator<<(std::ostream&, int)’:
/usr/include/kdtree++/kdtree.hpp:38: error: ‘__T’ was not declared in this scope
/usr/include/kdtree++/kdtree.hpp:46: error: expected initializer before ‘<’ token
/usr/include/kdtree++/kdtree.hpp:47: error: ‘_Tree’ has not been declared
/usr/include/kdtree++/kdtree.hpp:47: error: invalid type in declaration before ‘;’ token
/usr/include/kdtree++/kdtree.hpp:56: error: invalid type argument of ‘unary *’
/usr/include/kdtree++/kdtree.hpp:57: error: ‘_Tree’ has not been declared
/usr/include/kdtree++/kdtree.hpp:57: error: ‘_Tree’ has not been declared
/usr/include/kdtree++/kdtree.hpp:58: error: ‘_Tree’ has not been declared
/usr/include/kdtree++/kdtree.hpp:58: error: ‘_Tree’ has not been declared
/usr/include/kdtree++/kdtree.hpp: At global scope:
/usr/include/kdtree++/kdtree.hpp:75: error: declaration of ‘typedef typename KDTree::_Alloc_base<_Val, _Alloc>::allocator_type KDTree::KDTree<__K, _Val, _Acc, _Cmp, _Alloc>::allocator_type’
/usr/include/kdtree++/kdtree.hpp:73: error: conflicts with previous declaration ‘typedef _Alloc KDTree::KDTree<__K, _Val, _Acc, _Cmp, _Alloc>::allocator_type’
/usr/include/kdtree++/kdtree.hpp: In instantiation of ‘KDTree::KDTree<3u, IndexedPoint, KDTree::_Bracket_accessor<IndexedPoint>, std::less<float>, std::allocator<KDTree::_Node<IndexedPoint> > >’:
include/votingMachine.h:42: instantiated from here
/usr/include/kdtree++/kdtree.hpp:751: error: template-id ‘operator<< <>’ for ‘std::basic_ostream<char, std::char_traits<char> >& KDTree::operator<<(std::basic_ostream<char, std::char_traits<char> >&, const KDTree::KDTree<3u, IndexedPoint, KDTree::_Bracket_accessor<IndexedPoint>, std::less<float>, std::allocator<KDTree::_Node<IndexedPoint> > >&)’ does not match any template declaration
I forgot to add this. The code that launches the errors is as simple as the following:
#include <stdlib.h> +/kdtree. hpp>
#include <iostream>
#include <vector>
#include <set>
#include <kdtree+