Kdnssd Not working in Release Mode Qt c++
The Library Did not work when compiled in Release mode backed by Bonjour, I Build it in Windows for MSVC by !18 (closed), Here is the Reproducible Example,
#include <KDNSSD/PublicService>
#include <QCoreApplication>
#include <iostream>
int main(int argc, char **argv) {
QCoreApplication app(argc, argv);
KDNSSD::PublicService *service = new KDNSSD::PublicService("My files", "_http._tcp", 80);
std::cout << "Service: " << service->serviceName().toStdString() << std::endl;
bool isOK = service->publish();
std::cout << "Published: " << isOK << std::endl;
return app.exec();
}
When you compile in debug mode it will print published 1 but in Release mode it gets stuck in the publish, I also asked about this in Stackoverflow The logs I noted in release mode are,
QSocketNotifier: Can only be used with threads started with QThread
qt.core.qobject.connect: QObject::connect: Connecting from COMPAT signal (QSocketNotifier::activated(int))
In Debug Mode,
qt.core.qobject.connect: QObject::connect: Connecting from COMPAT signal (QSocketNotifier::activated(int))
I don't know what happens in Release mode, Thanks :)
Edited by Sri Lakshmi Kanthan P