Наследование шаблона
От: vlad0922  
Дата: 19.04.13 10:37
Оценка:
Добрый вечер.

Есть класс

#ifndef VECT_H
#define VECT_H

#include<iostream>

template<typename T>
class vect
{
    public:
int n;
T *array;
void create(int count);
virtual void setElement(int number, T source);
T get(int number);
};

#endif


который наследуется другим классом

#ifndef SET_HPP
#define SET_HPP

#include "vect.h"

template<typename T>
class Set : public vect<T>
{
void sort();
bool check (int element);
    public:
void setElement(int number, T source);
void print();
};

#endif


Все функции заданы в соответсвующих .cpp файлах.
При попытке выполнения такого кода

#include <iostream>

#include "set.h"

int main(int argc, char** argv) {
Set<int> t;

t.create(10);
for (int i=0;i<10;i++)
t.setElement(i,i);

t.print();

return 0;
}


Выдает ошибки:
main.cpp.text+0xc8): undefined reference to `vect<int>::create(int)'
main.cpp.text+0xed): undefined reference to `Set<int>::setElement(int, int)'
main.cpp.text+0x10f): undefined reference to `Set<int>::print()'

Можете подсказать, как их решить?
Заранее спасибо за ответ.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.