title: qt signal undefined reference error
body: <p>I have a class server for which I have created a signal joined(QString name). I call it in a function called join(QString name), however I'm getting the error</p>
  
  <blockquote>
    <p>Server.o: In function <code>Server::join(QString)':
    Server.cpp:(.text+0x48): undefined reference to
    </code>Server::joined(QString)' collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p>This is what my header file looks like:</p>
  
  <pre><code>#ifndef SERVER_H
  #define SERVER_H
  
  #include &lt;QString&gt;
  #include &lt;mqueue.h&gt;
  #include &lt;QVector&gt;
  #include &lt;QStringList&gt;
  #include "../src/messages.h"
  
  class Server
  {
  public:
      Server();
      void start();
  private:
      void join(QString name);
      char buf[MSG_SIZE], msgSend[MSG_SIZE];
      QVector&lt;mqd_t&gt; mq_external;
      QVector&lt;QString&gt; users;
      mqd_t mq_central;
      struct mq_attr attr;
  
  
  signals:
      void joined(QString name);
  
  };
  
  #endif // SERVER_H
  </code></pre>
  
  <p>and this is my cpp file:</p>
  
  <pre><code>#include "Server.h"
  
  using namespace std;
  
  Server::Server()
  {
  }
  
  void Server::start(){
  
      attr.mq_maxmsg = 100;
      attr.mq_msgsize = MSG_SIZE;
      attr.mq_flags = 0;
  
      mq_unlink(CENTRALBOX);
      mq_central = mq_open(CENTRALBOX, O_RDONLY | O_CREAT, S_IRWXU, &amp;attr);
      while(1)
      {
          int tempMsgVal = mq_receive(mq_central, buf, MSG_SIZE, 0);
          if(tempMsgVal != -1){
              QString tempS = buf;
              QStringList tempSL = tempS.split(":");
              if(tempSL.size() == 2 &amp;&amp; tempSL.at(0) == "started")
              {
                  int x = 0;
                  bool exists = false;
                  for(int i = 0; i &lt; mq_external.size(); i++)
                  {
                      x = QString::compare(tempSL[1], users.at(i), Qt::CaseInsensitive);
                      if(x == 0)
                      {
                          exists = true;
                          break;
                      }
                  }
  
                  if(!exists)
                  {
                      sprintf(buf,"joined");
                      QString tempS1 = tempSL[1] + "new";
                      QByteArray byteArray = tempS1.toUtf8();
                      const char* tempr = byteArray.constData();
                      mqd_t tempMQ = mq_open(tempr, O_RDWR);
                      int tempI = mq_send(tempMQ, buf, strlen(buf), 0);
                  }
                  else
                  {
                      sprintf(buf,"invalidname");
                      QString tempS1 = tempSL[1] + "new";
                      QByteArray byteArray = tempS1.toUtf8();
                      const char* tempr = byteArray.constData();
                      mqd_t tempMQ = mq_open(tempr, O_RDWR);
                      int tempI = mq_send(tempMQ, buf, strlen(buf), 0);
                  }//Endelse
              }//Endif
          }//Endif
  
      }//Endwhile
  }
  
  void Server::join(QString name)
  {
      emit joined(name);
  }
  </code></pre>