Boost logo

Ublas :

Subject: [ublas] Compilation error: error: expected nested-name-specifier before ‘VEC_T’
From: Parker Jones (zoubidoo_at_[hidden])
Date: 2009-12-11 08:20:25


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 jobs from NZ's #1 job site 1000s of jobs online right now!
http://clk.atdmt.com/NMN/go/157639089/direct/01/