I get a weird error I dont understand:
Code:
fearray.h:56: error: non-template `fearray' used as template
fearray.h:56: error: (use `fearray<type>::template fearray' to indicate that it is a template)
Code:
template <class type> struct fearray
{
typedef unsigned sizetype;
fearray() : Data(0), Size(0) { }
fearray(const fearray&);
fearray(const type*, sizetype);
~fearray();
fearray& operator=(const fearray&);
type& operator[](sizetype I) { return Data[I]; }
const type& operator[](sizetype I) const { return Data[I]; }
void Allocate(sizetype);
void Add(const type&);
void Clear();
const type& GetRandomElement() const { return Data[RAND_N(Size)]; }
type* Data;
sizetype Size;
};
.....
56: template <class type> inline fearray<type>::~fearray<type>()
there is one #include in the header file, which has this line:
Code:
template <class type> struct fearray;
how can i fix this?
#1) I've comment out the template definition started in line 56. now it does build something.
#2) seems working, there was another template with such a class constructor (!?) "~...",
also comment out and it does build the thing.
one type conversation error, tmp fixed with -fpermissive -
it #define LINUX, which was used for those posix/directory stuff. "fixed" with renaming to LINUX2 in src code
now let's see what will be the result :Spin
#3) hmm, those template are needed when linking - exactly the comment-out templates are missing:
Code:
undefined reference to `fearray<contentscript<item> >::~fearray()'
undefined reference to `contentmap<glterrain, contentscript<glterrain>>::~contentmap()'
so what is worng with the non-template thing? anyone can help here?
I wrote a PM to alkis