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

Build dll qt 5.6.3 with "/INTEGRITYCHECK" option



  • hello
    I want to add "IntegrityCheck" option to qt when i build it with msvc2010. So I have edited the value of flag QMAKE_LFLAGS_DLL to "/DLL /INTEGRITYCHECK" in file "...\Qt\5.6.3\qtbase\mkspecs\common\msvc-desktop.conf"

    And i get this error

    call C:\Qt\5.6.3\qtbase\src\widgets\uic_wrapper.bat dialogs\q
    filedialog.ui -o .uic\ui_qfiledialog.h
    NMAKE : fatal error U1077: 'call' : return code '0xc0000428'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\BIN\amd64\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    

    How can I fix it? Can you show me another way to make this easier?
    Thank a lot.


  • Lifetime Qt Champion

    Hi,

    Maybe a silly question but can you build Qt without your modification ?



  • @SGaist yes. If i don't modify this flag, I will build qt from source successfully. I checked it out. But I need build dll qt with "/INTEGRITYCHECK" option. So I have editted this flag. Thanks for the reply...


  • Lifetime Qt Champion

    Are you doing a completely fresh build after modifying the mkspec ?



  • @SGaist yes. I build qt from completely new source code


  • Lifetime Qt Champion

    What parameters are you passing to configure ?



  • @SGaist This is my parameters for configure.

    configure.bat -prefix C:\Qt\5.6.3\x86 -mp -opensource -confirm-license -nomake tests -nomake examples -no-compile-examples -release -shared -pch -no-ltcg -accessibility -no-sql-sqlite -opengl desktop -no-openvg -no-nis -no-iconv -no-evdev -no-mtdev -no-inotify -no-eventfd -largefile -no-system-proxies -qt-zlib -qt-pcre -no-icu -qt-libpng -qt-libjpeg -qt-freetype -no-fontconfig -qt-harfbuzz -no-angle -incredibuild-xge -no-plugin-manifests -qmake -qreal double -rtti -strip -no-ssl -no-openssl -no-libproxy -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug -no-direct2d -directwrite -no-style-fusion -native-gestures -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtconnectivity -skip qtdeclarative -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns
    

    PS: I have switched to build qt 5.6.3 and still have the same error

    process building qt stopped when it call file uic_wrapper.bat. So I try opening this file and receive popup error message

    \qtbase\lib\Qt5Core.dll is either not designed to run on windows or it contains an error. Try installing the program again using original installation media or contact your system asministrator or the sofware vendor for support
    

    What should I do?


  • Lifetime Qt Champion

    Afaics you must also sign the Dlls - simply passing this flag will not help (and the check will fail because the dll is not signed) - https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx



  • @Christian-Ehrlicher thank for helping. I have solved my problem. Thank you


  • Lifetime Qt Champion

    Great !

    Can you share the details ? It could be useful in the future for other people trying to do the same thing as you.



  • To fix the error when building dll qt with "/ INTEGRITYCHECK" option, you must sign Qt5Core.dll and Qt5Xml.dll before building qt. Two dlls is located in ".\qtbase\lib". You can use Windows Driver Development Kit for signing dlls . After successfully building qt, you must sign all the dlls which you need to use.
    To check the Integrity Check flag has been set in dll headers, you can use this command:

    Link.exe /dump /headers [name].dll
    

    Check under “DLL characteristics”, it should have “Check integrity” option
    Link download WDK: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11800


  • Lifetime Qt Champion

    Thanks !


Log in to reply