why do you allocate the serial port on the stack?
make it a member, this way you don't need to allocate it in every method, and better on the heap.
how to allocate it on heap??
all i have done is made it a global member like this --->

Qt Code:
  1. Posix_QextSerialPort *sp = new Posix_QextSerialPort("/dev/ttyS0");
To copy to clipboard, switch view to plain text mode 

but its still not working. the error is the same.