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. Building for Windows Intel on ARM hardware: crash on run (mfc140ud)
Forum Update on Monday, May 27th 2025

Building for Windows Intel on ARM hardware: crash on run (mfc140ud)

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 920 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    Using Qt6.8.0-beta1 (with VS2022), i am building and debugging an Intel target on my ARM device (running Windows 11). Using Qt6.7.x (With VS2019), this was no issue: I could build, debug, and deploy release versions, without any problem. However, with Qt6.8, attempting to run, i get this:

    c72fda6f-c9b0-4aa2-9d58-328397922df1.png

    with the call stack simply showing this:
    87fb4d71-1de4-4597-94e2-f7ff2003f3b8.png
    now, a gracious guru @hskoglund has kindly responded (on a thread with the wrong topic) that 0xC000026f is likely due to mixing ARM and Intel libraries:

    Hi, 0xc000026f usually means one or more of the dlls your Intel x64 app tries to 
    load is for the ARM architecture (or the other way around), so maybe check what
    flavor of mfc140ud your path is set for.
    

    Other than only installing the (x86 and x64) versions of mfc140 when running the VS Installer (and NOT installing (ARM) versions), how do i determine if the flavor of mfc140ud is in fact correct? get info on the lib doesn't tell me if the binary is ARM vs Intel.

    On mac (building on an ARM computer) i can specify in the QMake panel which "ABIs" i want: x86 and/or ARM. But on windows, there is no such UI switch. i'm not sure where else to look, or how to determine which is being selected when linking / deploying?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #10

      oh wow! the solution was to manually stage mfc140u(d).dll when executing the deploy phase. I did that and bingo, it all works. Huh. i guess this is a new requirement with VS2022.

      1 Reply Last reply
      1
      • cristian-adamC Offline
        cristian-adamC Offline
        cristian-adam
        wrote on last edited by
        #2

        Check your Qt 6.8 Kit for the right compilers. On an Arm64 you would want to use the arm64_amd64 cross-compiler, so that you won't go through the emulation.

        You can then on your Project right click and open Open Command Prompt With > Build Environment.

        In the environment you can do a:

        $ set | findstr LIB
        LIB=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64
        

        This way you could figure out if the correct LIB environment variable is being used.

        Lastly you can open the Makefile and look into it, to see what's going on. Who is linking to what.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #3

          These are the available compilers:
          Screenshot 2024-07-08 at 12.48.20 PM.png

          This is what i see when i do the command you suggested (separated by lines for easier reading):

          Z:\depot\kJams\Development\qt\kJams>set | findstr LIB
          LIB=
          C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64;
          C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x64;
          C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;
          C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;
          C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64
          
          LIBPATH=
          C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64;
          C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x64;
          C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x86\store\references;
          C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;
          C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0;
          C:\Windows\Microsoft.NET\Framework64\v4.0.30319
          

          When you say MakeFile, do you mean .qmake.stash ? If so, this is the contents:

          QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
          QMAKE_CXX.QMAKE_MSC_VER = 1940
          QMAKE_CXX.QMAKE_MSC_FULL_VER = 194033811
          QMAKE_CXX.COMPILER_MACROS = \
              QT_COMPILER_STDCXX \
              QMAKE_MSC_VER \
              QMAKE_MSC_FULL_VER
          QMAKE_CXX.INCDIRS = \
              "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\include" \
              "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\ATLMFC\\include" \
              "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\ucrt" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\um" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\shared" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\winrt" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\cppwinrt" \
              "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um"
          QMAKE_CXX.LIBDIRS = \
              "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\ATLMFC\\lib\\x64" \
              "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\lib\\x64" \
              "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\ucrt\\x64" \
              "C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.26100.0\\\\um\\x64"
          

          I have ensured that my packaging scripts use the correct SDK version 10.0.26100.0, and the correct MSVC version: 14.40.33807, yet i still get the same issue. can you glean anything from the above information?

          artwawA 1 Reply Last reply
          0
          • D davecotter

            These are the available compilers:
            Screenshot 2024-07-08 at 12.48.20 PM.png

            This is what i see when i do the command you suggested (separated by lines for easier reading):

            Z:\depot\kJams\Development\qt\kJams>set | findstr LIB
            LIB=
            C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64;
            C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x64;
            C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;
            C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64;
            C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64
            
            LIBPATH=
            C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64;
            C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x64;
            C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x86\store\references;
            C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.26100.0;
            C:\Program Files (x86)\Windows Kits\10\References\10.0.26100.0;
            C:\Windows\Microsoft.NET\Framework64\v4.0.30319
            

            When you say MakeFile, do you mean .qmake.stash ? If so, this is the contents:

            QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
            QMAKE_CXX.QMAKE_MSC_VER = 1940
            QMAKE_CXX.QMAKE_MSC_FULL_VER = 194033811
            QMAKE_CXX.COMPILER_MACROS = \
                QT_COMPILER_STDCXX \
                QMAKE_MSC_VER \
                QMAKE_MSC_FULL_VER
            QMAKE_CXX.INCDIRS = \
                "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\include" \
                "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\ATLMFC\\include" \
                "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\ucrt" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\um" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\shared" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\winrt" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.26100.0\\\\cppwinrt" \
                "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um"
            QMAKE_CXX.LIBDIRS = \
                "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\ATLMFC\\lib\\x64" \
                "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.40.33807\\lib\\x64" \
                "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\ucrt\\x64" \
                "C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.26100.0\\\\um\\x64"
            

            I have ensured that my packaging scripts use the correct SDK version 10.0.26100.0, and the correct MSVC version: 14.40.33807, yet i still get the same issue. can you glean anything from the above information?

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #4

            @davecotter I see you have selected amd64, not arm? I

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by davecotter
              #5

              thanks @artwaw, above, @cristian-adam suggested that i should use use the arm64_amd64 compiler, however, i do not see that in my list of choices?

              my apologies if i'm missing something that seems obvious to you, please forgive me, and can you just point it out? thanks so much for your time and attention.

              1 Reply Last reply
              0
              • cristian-adamC Offline
                cristian-adamC Offline
                cristian-adam
                wrote on last edited by
                #6

                Your environment looks correct. LIB has:

                C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64
                

                I would suggest renaming the C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\arm64 directory to something else, and see who will then complain that the library is not found for linking.

                D 1 Reply Last reply
                0
                • cristian-adamC Offline
                  cristian-adamC Offline
                  cristian-adam
                  wrote on last edited by
                  #7

                  Regarding the native arm64 compilers, I would suggest you to have them installed (including ninja and CMake) so that you have the best compilation times on the Arm64 machine.

                  You need to open Visual Studio Installer, then click on Modify for your installation and then click on the Individiual Components and there type arm64.

                  1 Reply Last reply
                  0
                  • cristian-adamC cristian-adam

                    Your environment looks correct. LIB has:

                    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64
                    

                    I would suggest renaming the C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\arm64 directory to something else, and see who will then complain that the library is not found for linking.

                    D Offline
                    D Offline
                    davecotter
                    wrote on last edited by davecotter
                    #8

                    @cristian-adam said in Building for Windows Intel on ARM hardware: crash on run (mfc140ud):

                    I would suggest renaming the ...\arm64 directory

                    I have done this (named it x arm64), but it behaves exactly the same. it compiles, links, deploys, launches, crashes in the same spot.

                    @cristian-adam said in Building for Windows Intel on ARM hardware: crash on run (mfc140ud):

                    I would suggest you to have [native arm64 compliers] installed

                    i typed arm64 into the search box under "individual components", but i've no idea which thing to install. What we want is a cross compiler, right? one that is ARM native yet emits intel instructions, right? so which one do i pick?

                    Screenshot 2024-07-09 at 8.29.38 AM.png

                    You also suggest:

                    including ninja and CMake

                    but don't they auto-install when i run QT Maintenance Tool ?

                    1 Reply Last reply
                    0
                    • cristian-adamC Offline
                      cristian-adamC Offline
                      cristian-adam
                      wrote on last edited by
                      #9

                      have done this (named it x arm64), but it behaves exactly the same. it compiles, links, deploys, launches, crashes in the same spot.

                      You'll have to see where the mfc140ud.dll is being loaded. You can manually copy it from "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.40.33807\debug_nonredist\x64\Microsoft.VC143.DebugMFC\mfc140ud.dll" to your build directory and see if it loads.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        davecotter
                        wrote on last edited by
                        #10

                        oh wow! the solution was to manually stage mfc140u(d).dll when executing the deploy phase. I did that and bingo, it all works. Huh. i guess this is a new requirement with VS2022.

                        1 Reply Last reply
                        1
                        • D davecotter has marked this topic as solved on
                        • D Offline
                          D Offline
                          davecotter
                          wrote on last edited by
                          #11
                          This post is deleted!
                          1 Reply Last reply
                          0

                          • Login

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