Hi!

Code:

Header
Qt Code:
  1. template <class D>
  2. class Signal
  3. : public QObject
  4. {
  5. public:
  6. void signal(D);
  7. signals:
  8. void send(D);
  9. };
To copy to clipboard, switch view to plain text mode 


cpp
Qt Code:
  1. template <class D> void Signal<D>::signal(D data)
  2. {
  3. emit send(data);
  4. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. namespace plot{
  2. Signal* xSignal;
  3. }
  4. //------------------------
  5. plot::xSignal = new Signal();
  6. QObject::connect(plot::xSignal, SIGNAL(send(double)), this, SLOT(notImportant(double)));
To copy to clipboard, switch view to plain text mode 

Everything still works to compile here but in next step something happend

Qt Code:
  1. double data = 0;
  2. plot::xSignal->signal(data);
To copy to clipboard, switch view to plain text mode 

This code should send a signal to notImportant() like this:
First to "Signal::signal(double)" which send signal to "Signal::send(double)" which is connected to "notImportant(double)".
But I can't compile when I add the last line I got an error message.
Line:
Qt Code:
  1. plot::xSignal->signal(data);
To copy to clipboard, switch view to plain text mode 
Error message is:
Qt Code:
  1. error: undefined reference to `Signal<double>::signal(double)''
To copy to clipboard, switch view to plain text mode 

I am new to templates so it is propably someting wrong there.

Does any of you know whats wrong?

Thanks
Ubi

Sorry for my english, I am from Sweden