how to fix QT5.3 &&QT5.7 complier difference



  • These day I try to install QT5.7 on raspberry pi3, but failed, try to install QT5.3 on it. but when I try to downgrade my project to QT5.3 there is a compiler error:
    D:\Users\tong\Documents\FMT_L\png.h:505: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_structrp'
    typedef png_struct * PNG_RESTRICT png_structrp;
    but the project is OK under QT5.7, the source code contains libpng.
    i think there should be some gcc/g++ compiler difference, but i don't know how to fix them, can anyone helps me ? thank you !

                                   ^


  • @JiujiuTong said in how to fix QT5.3 &&QT5.7 complier difference:

    These day I try to install QT5.7 on raspberry pi3, but failed, try to install QT5.3 on it. but when I try to downgrade my project to QT5.3 there is a compiler error:
    D:\Users\tong\Documents\FMT_L\png.h:505: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_structrp'
    typedef png_struct * PNG_RESTRICT png_structrp;
    but the project is OK under QT5.7, the source code contains libpng.
    i think there should be some gcc/g++ compiler difference, but i don't know how to fix them, can anyone helps me ? thank you !

                                   ^
    

    more info:
    D:\Users\tong\Documents\FMT_L\png.h:506: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_const_structrp'
    typedef const png_struct * PNG_RESTRICT png_const_structrp;
    ^
    D:\Users\tong\Documents\FMT_L\png.h:507: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_inforp'
    typedef png_info * PNG_RESTRICT png_inforp;
    ^
    ...
    D:\Users\tong\Documents\FMT_L\png.h:941: error: unknown type name 'png_structrp'
    PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
    ^
    ...


  • Moderators

    @JiujiuTong said in how to fix QT5.3 &&QT5.7 complier difference:

    i think there should be some gcc/g++ compiler difference

    Do you use the same compiler with Qt 5.3 as you used with 5.7?



  • @jsulm
    hi,
    no,with each default mingw, QT5.3 is mingw482_32,QT5.7 is mingw53_32
    if QT5.3 compiler with mingw53_32,no compiler error ,but the App can't startup with an error code.


  • Moderators

    @JiujiuTong What is the error code?



  • @jsulm
    the error info is :
    during startup program exited with code:0xC0000139.


  • Moderators

    @JiujiuTong Do you use any libraries compiled with mingw482_32?
    You should debug to get more information (stack trace).



  • @jsulm
    actually it didn't enter the main function...


  • Moderators

    @JiujiuTong What about libraries?



  • @jsulm
    no, i do not include any libs, where can i find the default libs included?


  • Moderators

    @JiujiuTong You can use ldd for that.
    You can try to start your executable like this:

    strace YOUR_EXE
    

    maybe this will show something interesting.



  • @jsulm
    well, my current OS is windows 10...


  • Moderators

    @JiujiuTong But your target is Raspberry PI, right? Or are you running Windows on it?



  • @jsulm
    yes, my target is raspberry pi3,but my current project runs on windows, as you know, develop under windows are much easier,if everything works well, i will recompile it under raspberry pi3 environment.


  • Moderators



  • @jsulm
    ntdll!EtwEventProviderEnabled+0x1817:
    00007ffaacc8fc97 488b8c2400010000 mov rcx,qword ptr [rsp+100h] ss:000000000009f460=000000000009f820
    0:000> t
    ntdll!EtwEventProviderEnabled+0x181f:
    00007ffaacc8fc9f ffd3 call rbx {wow64!Wow64LdrpInitialize (000000006606bba0)}
    0:000> p
    ModLoad: 0000000000130000 00000000001dd000 WOW64_IMAGE_SECTION
    ModLoad: 0000000074ce0000 0000000074dc0000 WOW64_IMAGE_SECTION
    ModLoad: 0000000000130000 00000000001dd000 NOT_AN_IMAGE
    ModLoad: 0000000001170000 00000000012c6000 NOT_AN_IMAGE
    ModLoad: 0000000066050000 0000000066058000 C:\WINDOWS\system32\wow64cpu.dll
    ModLoad: 0000000074ce0000 0000000074dc0000 C:\WINDOWS\SysWOW64\KERNEL32.DLL
    ModLoad: 00000000779d0000 0000000077b4e000 C:\WINDOWS\SysWOW64\KERNELBASE.dll
    ModLoad: 00000000761d0000 000000007628e000 C:\WINDOWS\SysWOW64\msvcrt.dll
    ModLoad: 0000000077740000 0000000077887000 C:\WINDOWS\SysWOW64\USER32.dll
    ModLoad: 0000000076940000 0000000076a8f000 C:\WINDOWS\SysWOW64\GDI32.dll
    ModLoad: 0000000001900000 000000000da15000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Guid.dll
    ModLoad: 000000006d7c0000 00000000701ba000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Multimediad.dll
    ModLoad: 000000000da20000 0000000014ade000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Cored.dll
    ModLoad: 0000000068b00000 0000000068da7000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5MultimediaWidgetsd.dll
    ModLoad: 0000000014ae0000 0000000017be9000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Networkd.dll
    ModLoad: 0000000064780000 00000000648e6000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5SerialPortd.dll
    ModLoad: 00000000766e0000 000000007675b000 C:\WINDOWS\SysWOW64\ADVAPI32.dll
    ModLoad: 0000000076850000 0000000076894000 C:\WINDOWS\SysWOW64\sechost.dll
    ModLoad: 0000000076530000 00000000765dd000 C:\WINDOWS\SysWOW64\RPCRT4.dll
    ModLoad: 0000000074aa0000 0000000074abe000 C:\WINDOWS\SysWOW64\SspiCli.dll
    ModLoad: 0000000074a90000 0000000074a9a000 C:\WINDOWS\SysWOW64\CRYPTBASE.dll
    ModLoad: 0000000076290000 00000000762e8000 C:\WINDOWS\SysWOW64\bcryptPrimitives.dll
    ModLoad: 0000000077130000 000000007753b000 C:\WINDOWS\SysWOW64\SETUPAPI.dll
    ModLoad: 0000000076350000 0000000076387000 C:\WINDOWS\SysWOW64\CFGMGR32.dll
    ModLoad: 0000000017bf0000 0000000020b28000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Widgetsd.dll
    ModLoad: 0000000076a90000 0000000076c09000 C:\WINDOWS\SysWOW64\CRYPT32.dll
    ModLoad: 00000000764b0000 00000000764be000 C:\WINDOWS\SysWOW64\MSASN1.dll
    ModLoad: 0000000077cc0000 0000000077d1f000 C:\WINDOWS\SysWOW64\WS2_32.dll
    ModLoad: 0000000069340000 00000000694b4000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5Xmld.dll
    ModLoad: 0000000020b30000 000000002c4fd000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5XmlPatternsd.dll
    ModLoad: 00000000778e0000 00000000779cb000 C:\WINDOWS\SysWOW64\ole32.dll
    ModLoad: 0000000077550000 000000007770d000 C:\WINDOWS\SysWOW64\combase.dll
    ModLoad: 000000002c500000 000000002c523000 D:\Qt\4.8.6\bin\libgcc_s_dw2-1.dll
    ModLoad: 0000000074dc0000 00000000761be000 C:\WINDOWS\SysWOW64\SHELL32.dll
    ModLoad: 0000000076c10000 000000007710a000 C:\WINDOWS\SysWOW64\windows.storage.dll
    ModLoad: 0000000077d20000 0000000077d65000 C:\WINDOWS\SysWOW64\shlwapi.dll
    ModLoad: 00000000764c0000 00000000764cc000 C:\WINDOWS\SysWOW64\kernel.appcore.dll
    ModLoad: 0000000076420000 00000000764ad000 C:\WINDOWS\SysWOW64\shcore.dll
    ModLoad: 0000000064940000 0000000064953000 D:\Qt\4.8.6\bin\libwinpthread-1.dll
    ModLoad: 00000000764e0000 0000000076524000 C:\WINDOWS\SysWOW64\powrprof.dll
    ModLoad: 0000000077540000 000000007754f000 C:\WINDOWS\SysWOW64\profapi.dll
    ModLoad: 000000002c530000 000000002c623000 D:\Qt\4.8.6\bin\libstdc++-6.dll
    ModLoad: 000000006b7c0000 000000006c6c2000 D:\Qt\Qt5.7.0\5.7\mingw53_32\bin\Qt5OpenGLd.dll
    ModLoad: 0000000073e40000 0000000073ec4000 C:\WINDOWS\SysWOW64\DNSAPI.DLL
    ModLoad: 00000000748a0000 00000000748cf000 C:\WINDOWS\SysWOW64\IPHLPAPI.DLL
    ModLoad: 00000000767c0000 00000000767c7000 C:\WINDOWS\SysWOW64\NSI.dll
    ModLoad: 00000000730b0000 00000000730c6000 C:\WINDOWS\SysWOW64\MPR.DLL
    (1bac.19f8): Unknown exception - code c0000139 (first chance)
    (1bac.aa4): Unknown exception - code c0000139 (first chance)
    WARNING: Step/trace thread exited
    *** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\WINDOWS\system32\wow64cpu.dll -
    wow64cpu!TurboDispatchJumpAddressEnd+0x540:
    00000000`660521bc c3 ret


  • Moderators

    @JiujiuTong Why do you have Qt 4.8.6 related DLLs here:

    D:\Qt\4.8.6\bin\libgcc_s_dw2-1.dll
    D:\Qt\4.8.6\bin\libwinpthread-1.dll
    D:\Qt\4.8.6\bin\libstdc++-6.dll
    

    Did you add D:\Qt\4.8.6\bin to your PATH?



  • @jsulm
    depend libs:
    QT5CORED.DLL
    QT5GUID.DLL
    QT5MULTIMDEIA.DLL
    QT5NETWORK.DLL
    QT5MULTIMDEIAWIDGETSD.DLL
    QT5SERIALPORTD.DLL
    QT5WIDGETSD.DLL
    QT5XMLD.DLL
    QT5XMLPATTERNSD.DLL
    LIBGCC_S_DW2-1.DLL
    KERNEL32.dll
    MSVCRT.DLL
    LIBWINPTHREAD-1.DLL
    USER32.DLLLIBSTDC++-6.DLL


  • Moderators

    @JiujiuTong Again: why do you have this:

    D:\Qt\4.8.6\bin\libgcc_s_dw2-1.dll
    D:\Qt\4.8.6\bin\libwinpthread-1.dll
    D:\Qt\4.8.6\bin\libstdc++-6.dll
    

    Those are most probably built using an older GCC version and are probably the reason for the crash.



  • @jsulm
    I'm used to develop program under QT4.8.6,so it contains the path.
    is it the reason? i will delete it


  • Moderators

    @JiujiuTong "QT5.3 compiler with mingw53_32,no compiler error ,but the App can't startup with an error code" - actually this cannot work, as your Qt 5.3 is built with older MinGW version. You cannot mix binaries built with different compilers.


  • Moderators

    @JiujiuTong You should not add Qt to PATH if you have more than one version of it.



  • @jsulm
    do you mean that QT5.3 should compile with its default Mingw?



  • @jsulm
    i removed all QT (MINGW) related PATH, and reboot the OS, it is the same error


  • Moderators

    @JiujiuTong Did you rebuild your project?
    And as I said: your Qt 5.3 is built using an older MinGW as you're now using to build your project - this is not going to work.



  • @jsulm
    yes, i rebuild them, a litter different, the windbg can't startup the program, error qt5guid.dll is missing



  • @JiujiuTong said in how to fix QT5.3 &&QT5.7 complier difference:

    @jsulm
    yes, i rebuild them, a litter different, the windbg can't startup the program, error qt5guid.dll is missing

    tips that the all depend qt5*.dll are missing.
    if we can't do this, how can i fix the error:
    D:\Users\tong\Documents\FMT_L\png.h:506: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_const_structrp'
    typedef const png_struct * PNG_RESTRICT png_const_structrp;
    ^
    D:\Users\tong\Documents\FMT_L\png.h:507: error: expected '=', ',', ';', 'asm' or 'attribute' before 'png_inforp'
    typedef png_info * PNG_RESTRICT png_inforp;
    ^
    ...
    D:\Users\tong\Documents\FMT_L\png.h:941: error: unknown type name 'png_structrp'
    PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));


  • Moderators

    @JiujiuTong Actually you should fix your Qt 5.7 issues with Raspberry Pi. Qt 5.3 is quite old. You can try Qt 5.8.



  • @jsulm
    well , i hope so


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.