Signal slot crash with static object
I wanted to interface my Qt class in a "C" application. For that I have created static object in my application as follows. When the code start execution, it constructs "MyQtClass", and in this construtor the code crashes at the "connect" call!! I think the following code would be more readable than my explanation.
class MyQtClass:public QTcpSocket
bool Connect(QHostAddress addr,quint16 port);
//executing this line causes a crash
static MyQtClass comm;
int Connect(char* host, unsigned short port)
What is the reason for crash?
What crash? Once I provide and empty implementation for the missing destructor, slot,and Connect() function and a do nothing main() the code compiles and runs without error.
You need to rebuild the program am run it in a debugger. When it crashes look at the backtrace to find out what is causing it to die.