This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Template problem


Hi,

        I compiled the program Xvision perfetly under RedHat, but now I`ve
install Mandrake and It's no possible.
When I typing make the exit is:

 make

g++  -g -I- -I. -I~/xvision/include -I~/xvision -w -c prueba.cxx -o prueba.o
In file included from Video.hh:41,
                 from CWindow.hh:34,
                 from BasicFeature.hh:37,
                 from FTypes.hh:32,
                 from Line.hh:33,
                 from prueba.cxx:5:
Image.hh:31: return type specified for `operator XVImage<float>'
make: *** [prueba.o] Error 1


The file Image.hh is:

    #ifndef Image_hh
#define Image_hh

#include "Tracker.hh"
#include "XVImage.hh"

class Image : public XVImage<int>
{
  public:

  Image (int ncols_in = 0, int nrows_in = 0)
    : XVImage<int>(nrows_in, ncols_in)
  {}

  Image (XVImage<int>& im)
    : XVImage<int>(im)
  {}


#if (XV_OS == XV_IRIX)
  operator XVImage<float>() {
    float* floatData = new float[storesize];

    for (int i = 0; i < storesize; i++)
      floatData[i] = (float)image[i];
    XVImage<float> newImage(nrows, ncols, floatData
    delete floatData;
    return newImage;
  }
#else
  XVImage<float> operator XVImage<float>()
{                                                          //Number of line 31
    float* floatData = new float[storesize];

    for (int i = 0; i < storesize; i++)
      floatData[i] = (float)image[i];
    XVImage<float> newImage(nrows, ncols, floatData
    delete floatData;
    return newImage;
  }
#endif

};

#endif Image_hh




And the lines where is implemented in another file is:

template <class T> XVImage<T> &operator >>(const ColVector &x,XVImage<T> &y);
template <class T> XVImage<T> &operator >>(const RowVector &x,XVImage<T> &y);

Can anyboby help me?


Sorry for my english

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]