Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

why does my program need Qt5Network.dll? even with -network in .pro?



  • Hello,
    I've done a console application depending on QtCore, QtXml and QtXmlPatterns.
    When I build for Windows, the exe needs Qt5Network.dll.
    Any ideas why?
    Here is my .pro config:

    QT += core xml xmlpatterns
    QT -= gui network
    CONFIG -= app_bundle
    CONFIG += c++11
    
    CONFIG(release, debug|release): DEFINES += QT_NO_DEBUG_OUTPUT
    
    TEMPLATE = app
    

    Cheers



  • @mbruel

    Did you change from

    QT +=network
    

    to

    QT -= network
    

    recently?
    Try to rerun qmake and make a complete rebuild of the project.
    Note, also if one of your other libraries requires network there might be the cause.



  • Hi @mbruel,

    It's because xmlpatterns depends on the network module (eg for schema and XML query features).

    Cheers.



  • ok thanks,
    in fact I was also using QHostInfo that directly depends on the network module.
    I've removed this call and also the dependency on xmlpatterns that I didn't really need.
    All good now, I just need Qt5Core.dll and Qt5Xml.dll.

    I still have something bothering me, when I excute the program on Windows 10, I've a security alert.
    alt text
    Any ideas why?
    The app is lanched via a batch script using a simple argument. It load an xml file, does some computation and generate xml reports.


  • Lifetime Qt Champion

    @mbruel
    Hi its hard to guess at what triggers the warning.
    Try upload .exe to
    https://www.virustotal.com
    and see what it says.



  • well the app is quite confidential so I can't upload it online.
    I've done an basic installer using Inno Setup (so I package the exe and the Qt dlls) and now it is not triggering the anti-virus.
    Is it because it is registering the app in the Windows registry? (I'm setting an AppId)


  • Lifetime Qt Champion

    @mbruel
    Ok. All from access c:\ to .bat files, to registry access can trigger
    such false positives. Only Trend Micro can really say.



  • As reported by trend micro that message is just telling you that the program you are executing is "unusual" and couldn't find reputation information for it online. That's just natural given you are building it and not distributing it. Your antivirus is just being overly-protective, this has nothing to do with Qt or anything else


Log in to reply