Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt app for windows XP

Qt app for windows XP

Scheduled Pinned Locked Moved Solved General and Desktop
28 Posts 4 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ODБOï
    wrote on 5 Jun 2020, 11:35 last edited by
    #3

    @JonB hi, thanks for answering
    @JonB said in Qt app for windows XP:

    patch level

    this is a windows xp pro version 2002 SP3
    on a CNC machine, it can not be updated/is never Updated and not connected to internet.

    Do you think that error can introduce bugs in the application itself ? In my opinion it should not because sprintf_s is just a printing method.

    Should i try to find a workaround to just hide that error ..?

    J 1 Reply Last reply 5 Jun 2020, 12:00
    0
    • O ODБOï
      5 Jun 2020, 11:35

      @JonB hi, thanks for answering
      @JonB said in Qt app for windows XP:

      patch level

      this is a windows xp pro version 2002 SP3
      on a CNC machine, it can not be updated/is never Updated and not connected to internet.

      Do you think that error can introduce bugs in the application itself ? In my opinion it should not because sprintf_s is just a printing method.

      Should i try to find a workaround to just hide that error ..?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 5 Jun 2020, 12:00 last edited by
      #4

      @LeLev I think this DLL is from "Microsoft Visual C++ Runtime". You could try to update it from here https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      O 1 Reply Last reply 5 Jun 2020, 12:11
      1
      • H Offline
        H Offline
        hskoglund
        wrote on 5 Jun 2020, 12:11 last edited by
        #5

        You can try this workaround, place it on top of mainwindow.h:

        #define sprintf_s _snprintf
        

        For a long-term solution, it might be safer to use MSVC2013 instead of MinGW49_32.

        O 1 Reply Last reply 5 Jun 2020, 12:23
        3
        • J jsulm
          5 Jun 2020, 12:00

          @LeLev I think this DLL is from "Microsoft Visual C++ Runtime". You could try to update it from here https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

          O Offline
          O Offline
          ODБOï
          wrote on 5 Jun 2020, 12:11 last edited by
          #6

          @jsulm ok thank you
          normally i am not supposed to do any updates/changes in the system but i will see it with my hierarchical superior i guess...

          1 Reply Last reply
          0
          • H hskoglund
            5 Jun 2020, 12:11

            You can try this workaround, place it on top of mainwindow.h:

            #define sprintf_s _snprintf
            

            For a long-term solution, it might be safer to use MSVC2013 instead of MinGW49_32.

            O Offline
            O Offline
            ODБOï
            wrote on 5 Jun 2020, 12:23 last edited by
            #7

            @hskoglund hi,

            @hskoglund said in Qt app for windows XP:

            #define sprintf_s _snprintf

            thank you for this suggestion
            This is a QtQuick QML application so i dont have mainwindow.h, i tryed to put that ligne in my main.cpp but i still have the error, Is there maybe a way to define it in my project file or somewhere else ?

            J 1 Reply Last reply 5 Jun 2020, 12:33
            0
            • O ODБOï
              5 Jun 2020, 12:23

              @hskoglund hi,

              @hskoglund said in Qt app for windows XP:

              #define sprintf_s _snprintf

              thank you for this suggestion
              This is a QtQuick QML application so i dont have mainwindow.h, i tryed to put that ligne in my main.cpp but i still have the error, Is there maybe a way to define it in my project file or somewhere else ?

              J Offline
              J Offline
              JonB
              wrote on 5 Jun 2020, 12:33 last edited by JonB 6 May 2020, 12:34
              #8

              @LeLev
              I am not convinced you will be able to resolve this via compile-time #define. The implication of

              the procedure entry point sprintf_s could not be located in msvcrt.dll

              is that it might be being loaded dynamically via LoadLibraray()/GetProcAddress().

              Have you tried/are you allowed to try @jsulm's suggestion of getting a better version of msvcrt.dll? That would be preferable. How many copies of that file do you have on your system (there may be multiple), and what is their exact version (you can see that from File Explorer Properties)?

              O 1 Reply Last reply 5 Jun 2020, 12:48
              1
              • H Offline
                H Offline
                hskoglund
                wrote on 5 Jun 2020, 12:34 last edited by
                #9

                Yeah, it's much better to put it the .pro file, try:

                DEFINES += "sprintf_s=_snprintf"
                
                1 Reply Last reply
                1
                • J JonB
                  5 Jun 2020, 12:33

                  @LeLev
                  I am not convinced you will be able to resolve this via compile-time #define. The implication of

                  the procedure entry point sprintf_s could not be located in msvcrt.dll

                  is that it might be being loaded dynamically via LoadLibraray()/GetProcAddress().

                  Have you tried/are you allowed to try @jsulm's suggestion of getting a better version of msvcrt.dll? That would be preferable. How many copies of that file do you have on your system (there may be multiple), and what is their exact version (you can see that from File Explorer Properties)?

                  O Offline
                  O Offline
                  ODБOï
                  wrote on 5 Jun 2020, 12:48 last edited by ODБOï 6 May 2020, 13:21
                  #10

                  @JonB said in Qt app for windows XP:

                  Have you tried/are you allowed to try @jsulm's suggestion of getting a better version of msvcrt.dll?

                  my superior will be back on Monday so sadely i can't try that for the moment..

                  @JonB said in Qt app for windows XP:

                  How many copies of that file do you have on your system

                  i found one in folder c:\windows\system32 , the version is 7.0.2600.5512
                  not sure how to search/find the others, im trying to find out
                  edit: searching in progress using XP search tool

                  i have 5 in total :
                  versions
                  7.0.2600.5512
                  7.0.2600.0
                  7.0.2600.5512
                  6.0.8337.0

                  @hskoglund said in Qt app for windows XP:

                  DEFINES += "sprintf_s=_snprintf"

                  unfortunately this still does not solve the issue

                  J 1 Reply Last reply 5 Jun 2020, 12:58
                  0
                  • O ODБOï
                    5 Jun 2020, 12:48

                    @JonB said in Qt app for windows XP:

                    Have you tried/are you allowed to try @jsulm's suggestion of getting a better version of msvcrt.dll?

                    my superior will be back on Monday so sadely i can't try that for the moment..

                    @JonB said in Qt app for windows XP:

                    How many copies of that file do you have on your system

                    i found one in folder c:\windows\system32 , the version is 7.0.2600.5512
                    not sure how to search/find the others, im trying to find out
                    edit: searching in progress using XP search tool

                    i have 5 in total :
                    versions
                    7.0.2600.5512
                    7.0.2600.0
                    7.0.2600.5512
                    6.0.8337.0

                    @hskoglund said in Qt app for windows XP:

                    DEFINES += "sprintf_s=_snprintf"

                    unfortunately this still does not solve the issue

                    J Offline
                    J Offline
                    JonB
                    wrote on 5 Jun 2020, 12:58 last edited by JonB 6 May 2020, 13:26
                    #11

                    @LeLev said in Qt app for windows XP:

                    i found one in folder c:\windows\system32 , the version is 7.0.2600.5512

                    Based on nothing, my Windows 7 one is 7.0.7601.17704, dated 16/12/2011. It shows there does at least exist a later one, though how that relates to XP I don't know.

                    If you know how to use a tool to look at what functions are in/exported from a DLL, you could verify that sprintf_s is indeed missing in yours.

                    normally i am not supposed to do any updates/changes in the system but i will see it with my hierarchical superior i guess...

                    I still maintain that the most likely is the SO post I pointed you at earlier. I point you at https://answers.microsoft.com/en-us/windows/forum/all/xp-sp3-update-021319-posready-2009-caused-a/d4546883-2d07-4688-b00d-4c74801b65cb or https://community.teamviewer.com/t5/General-Questions/XP-and-Teamviewer/td-p/54530 too, which I think is the same thing. At least whether you have those patches? Show this to your "hierarchical superior" :)

                    Otherwise, it could be a MinGW issue. Can't find exact match, but https://stackoverflow.com/questions/30590421/qt-5-4-0-deployment-issue-missing-vsprintf-s-in-msvcrt-dll/32320444.

                    O 1 Reply Last reply 5 Jun 2020, 13:12
                    1
                    • J JonB
                      5 Jun 2020, 12:58

                      @LeLev said in Qt app for windows XP:

                      i found one in folder c:\windows\system32 , the version is 7.0.2600.5512

                      Based on nothing, my Windows 7 one is 7.0.7601.17704, dated 16/12/2011. It shows there does at least exist a later one, though how that relates to XP I don't know.

                      If you know how to use a tool to look at what functions are in/exported from a DLL, you could verify that sprintf_s is indeed missing in yours.

                      normally i am not supposed to do any updates/changes in the system but i will see it with my hierarchical superior i guess...

                      I still maintain that the most likely is the SO post I pointed you at earlier. I point you at https://answers.microsoft.com/en-us/windows/forum/all/xp-sp3-update-021319-posready-2009-caused-a/d4546883-2d07-4688-b00d-4c74801b65cb or https://community.teamviewer.com/t5/General-Questions/XP-and-Teamviewer/td-p/54530 too, which I think is the same thing. At least whether you have those patches? Show this to your "hierarchical superior" :)

                      Otherwise, it could be a MinGW issue. Can't find exact match, but https://stackoverflow.com/questions/30590421/qt-5-4-0-deployment-issue-missing-vsprintf-s-in-msvcrt-dll/32320444.

                      O Offline
                      O Offline
                      ODБOï
                      wrote on 5 Jun 2020, 13:12 last edited by ODБOï 6 May 2020, 13:13
                      #12

                      @JonB said in Qt app for windows XP:

                      you have those patches?

                      i try to see patches list using systeminfo.exe in terminal

                      it returns :

                      1 Hotfix installed : Q147222

                      O 1 Reply Last reply 5 Jun 2020, 13:34
                      0
                      • O ODБOï
                        5 Jun 2020, 13:12

                        @JonB said in Qt app for windows XP:

                        you have those patches?

                        i try to see patches list using systeminfo.exe in terminal

                        it returns :

                        1 Hotfix installed : Q147222

                        O Offline
                        O Offline
                        ODБOï
                        wrote on 5 Jun 2020, 13:34 last edited by
                        #13

                        downloading
                        http://download.qt.io/new_archive/qt/5.6/5.6.0/qt-opensource-windows-x86-msvc2013-5.6.0.exe.mirrorlist
                        to give it a try

                        H 1 Reply Last reply 5 Jun 2020, 13:49
                        0
                        • O ODБOï
                          5 Jun 2020, 13:34

                          downloading
                          http://download.qt.io/new_archive/qt/5.6/5.6.0/qt-opensource-windows-x86-msvc2013-5.6.0.exe.mirrorlist
                          to give it a try

                          H Offline
                          H Offline
                          hskoglund
                          wrote on 5 Jun 2020, 13:49 last edited by
                          #14

                          @LeLev Don't forget that line in your .pro file:

                          QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
                          

                          P.S. Just tried an empty vanilla Qt 5.6.3 MinGW49_32 QtQuick QML project (where you see Hello World in the middle of 640x480 window. Built on Windows 10 and tested on Windows XP, worked fine without that sprintf_s error, the msvcrt.dll on that Windows XP has version 7.0.2600.5512.

                          Anyway, since MSVC2013 is Microsoft own stuff, it's more likely to survive as the years go by :-)

                          J O 2 Replies Last reply 5 Jun 2020, 13:52
                          3
                          • H hskoglund
                            5 Jun 2020, 13:49

                            @LeLev Don't forget that line in your .pro file:

                            QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
                            

                            P.S. Just tried an empty vanilla Qt 5.6.3 MinGW49_32 QtQuick QML project (where you see Hello World in the middle of 640x480 window. Built on Windows 10 and tested on Windows XP, worked fine without that sprintf_s error, the msvcrt.dll on that Windows XP has version 7.0.2600.5512.

                            Anyway, since MSVC2013 is Microsoft own stuff, it's more likely to survive as the years go by :-)

                            J Offline
                            J Offline
                            JonB
                            wrote on 5 Jun 2020, 13:52 last edited by
                            #15

                            @hskoglund said in Qt app for windows XP:

                            worked fine without that sprintf_s error, the msvcrt.dll on that Windows XP has version 7.0.2600.5512.

                            That should be interesting reading for @LeLev !

                            1 Reply Last reply
                            1
                            • H Offline
                              H Offline
                              hskoglund
                              wrote on 5 Jun 2020, 13:58 last edited by
                              #16

                              That misbehaved update from Microsoft last year which caused the sprintf_s error, it seems not to have touched msvcrt.dll directly, but rather some other files, but msvcrt.dll got the raw deal :-(

                              msvcrt.dll is somewhat of an unwanted child from Microsoft's point of view, for example here's what Raymond Chen writes: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273

                              O 2 Replies Last reply 5 Jun 2020, 13:59
                              1
                              • H hskoglund
                                5 Jun 2020, 13:58

                                That misbehaved update from Microsoft last year which caused the sprintf_s error, it seems not to have touched msvcrt.dll directly, but rather some other files, but msvcrt.dll got the raw deal :-(

                                msvcrt.dll is somewhat of an unwanted child from Microsoft's point of view, for example here's what Raymond Chen writes: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273

                                O Offline
                                O Offline
                                ODБOï
                                wrote on 5 Jun 2020, 13:59 last edited by ODБOï 6 May 2020, 14:01
                                #17

                                guys thank you very much for help and thank you for your time

                                1 Reply Last reply
                                0
                                • H hskoglund
                                  5 Jun 2020, 13:58

                                  That misbehaved update from Microsoft last year which caused the sprintf_s error, it seems not to have touched msvcrt.dll directly, but rather some other files, but msvcrt.dll got the raw deal :-(

                                  msvcrt.dll is somewhat of an unwanted child from Microsoft's point of view, for example here's what Raymond Chen writes: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273

                                  O Offline
                                  O Offline
                                  ODБOï
                                  wrote on 5 Jun 2020, 14:23 last edited by
                                  #18

                                  @hskoglund said in Qt app for windows XP:

                                  for example here's what Raymond Chen writes: https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=1273

                                  a real nightmare the story of this dll, just like my day ^^

                                  1 Reply Last reply
                                  0
                                  • H hskoglund
                                    5 Jun 2020, 13:49

                                    @LeLev Don't forget that line in your .pro file:

                                    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
                                    

                                    P.S. Just tried an empty vanilla Qt 5.6.3 MinGW49_32 QtQuick QML project (where you see Hello World in the middle of 640x480 window. Built on Windows 10 and tested on Windows XP, worked fine without that sprintf_s error, the msvcrt.dll on that Windows XP has version 7.0.2600.5512.

                                    Anyway, since MSVC2013 is Microsoft own stuff, it's more likely to survive as the years go by :-)

                                    O Offline
                                    O Offline
                                    ODБOï
                                    wrote on 5 Jun 2020, 14:38 last edited by
                                    #19

                                    @hskoglund said in Qt app for windows XP:

                                    Don't forget that line in your .pro file:
                                    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01

                                    i have error in compilation output saying
                                    g++: error: /SUBSYSTEM:WINDOWS,5.01: No such file or directory

                                    if i add this to my pro file
                                    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01

                                    1 Reply Last reply
                                    0
                                    • H Offline
                                      H Offline
                                      hskoglund
                                      wrote on 5 Jun 2020, 14:39 last edited by hskoglund 6 May 2020, 14:42
                                      #20

                                      That line is only applicable if you use the MSVC2013 compiler

                                      Edit: to satisfy both compilers, we can use a prefix, change the line to

                                      win32-msvc:QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
                                      
                                      1 Reply Last reply
                                      1
                                      • O Offline
                                        O Offline
                                        ODБOï
                                        wrote on 5 Jun 2020, 14:42 last edited by
                                        #21

                                        @hskoglund said in Qt app for windows XP:

                                        QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01

                                        oh ok! my bad, i was still trying with minGw

                                        1 Reply Last reply
                                        0
                                        • O Offline
                                          O Offline
                                          ODБOï
                                          wrote on 5 Jun 2020, 15:11 last edited by ODБOï 6 May 2020, 15:14
                                          #22

                                          @hskoglund , @JonB

                                          apparently qt-opensource-windows-x86-msvc2013-5.6.0 that i just installed doas not configure kits automatically,

                                          i have no compiler and no debugger in the kit, so i cant compile the project

                                          do i have to download the compiler separately ? i dont see it in my qt 5.6 install dir C:\Qt\Qt5.6.0\5.6\msvc2013\bin nor in C:\Qt\Qt5.6.0\Tools\

                                          compiler column is empty here..
                                          https://doc.qt.io/archives/qt-5.6/supported-platforms.html

                                          H 1 Reply Last reply 5 Jun 2020, 15:14
                                          0

                                          12/28

                                          5 Jun 2020, 13:12

                                          • Login

                                          • Login or register to search.
                                          12 out of 28
                                          • First post
                                            12/28
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved