Hello all,

I am compiling someone else's C++ application that uses UBLAS and am getting a compilation error:

$ g++ distance.h
distance.h:16: error: expected nested-name-specifier before ‘VEC_T’
distance.h:16: error: expected ‘;’ before ‘vector_type’
distance.h:33: error: expected nested-name-specifier before ‘VEC_T’
distance.h:33: error: expected ‘;’ before ‘vector_type’

Platform: Ubuntu 9.10, g++4.4, Boost 1.38.
I haven't touched C++ in over 10 years, so apologies if this is a trivial question.

Many thanks for any suggestions,
Parker

distance.h reads:

     1    #ifndef DISTANCE_H
     2    #define DISTANCE_H
     3    #include <boost/numeric/ublas/vector.hpp>
     4   
     5   
     6    namespace Metrics{
     7   
     8        // 
     9        // Euclidean distance
    10        template
    11        <typename VEC_T>   
    12        class Euclidean {
    13       
    14        protected:                 
    15   
    16            typedef typename VEC_T vector_type;
    17   
    18            // this must be not directly accessible
    19            // since we want to provide a rich set of distances   
    20   
    21            double getDistance(const VEC_T v1, const VEC_T v2)
    22            {
    23                return norm_2(v1-v2);
    24            };
    25        };
    26       
    27        template
    28        <typename VEC_T>   
    29        class Cosine {
    30       
[snip]   


Full source here: http://www.di.unipi.it/%7Egulli/coding/dbscan.zip



Search for a job now If it exists you'll find it on SEEK