I'm just not getting this right somehow. I would like to define a couple of static constants for a class, just like the static final variables in java. This is how I did it:

Qt Code:
  1. class SerialCommunication
  2. {
  3. private:
  4. static const qint64 RX_BUFFER_SIZE = 128;
  5. };
  6.  
  7. void SerialCommunication::receiveMsg()
  8. {
  9. char receiveBuffer[RX_BUFFER_SIZE];
  10. int bytesRead = port->read(receiveBuffer, qMin(port->bytesAvailable(), RX_BUFFER_SIZE));
  11. }
To copy to clipboard, switch view to plain text mode 

For the second call to RX_BUFFER_SIZE in the read() command I get a compiler error "undefined reference to SerialCommunication::RX_BUFFER_SIZE". How come the first one is ok then? What am I not doing right?