PDA

View Full Version : crash tool static build qt



davinciomar
10th September 2016, 01:23
Hi, when i try to build dinamically build run fine. But when i tried static i got this message:

Starting C:\Qt\Qt5.2.0\Tools\QtCreator\bin\build-qdnslookup-Unnamed-Debug\debug\qdnslookup.exe...
The program has unexpectedly finished.
C:\Qt\Qt5.2.0\Tools\QtCreator\bin\build-qdnslookup-Unnamed-Debug\debug\qdnslookup.exe crashed

So someone has some suggestion, the example :

void MainWindow::lookupServers()
{
// Create a DNS lookup.
QDnsLookup *dns = new QDnsLookup(this);
connect(dns, SIGNAL(finished()),
this, SLOT(handleServers()));

// Find the XMPP servers for gmail.com
dns->setType(QDnsLookup::SRV);
dns->setName("_xmpp-client._tcp.gmail.com");
dns->lookup();
}

d_stranz
10th September 2016, 19:35
Do you also have a member variable in the MainWindow class named "dns"? If you do, then the "dns" variable you declare and use in this method hides your member variable. If the member variable is never initialized anywhere, then if you try to use it elsewhere in your program, it will cause a crash.

What does your debugger tell you about the crash? Does it occur in the code you have posted, or somewhere else?

By the way, posting a quote is better than posting a screenshot, but it would be better if you used CODE tags. See my signature for how to do that.