Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt 64 bits application

Qt 64 bits application

Scheduled Pinned Locked Moved Solved Installation and Deployment
24 Posts 4 Posters 1.7k 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.
  • P Offline
    P Offline
    Pierre-Emmanuel
    wrote on 8 Jan 2025, 10:22 last edited by
    #1

    Hi everyone,

    First let me wish you a very happy new year !

    Then, I am struggling to build a 64-bits application which has 64-bits dll dependencies..

    A little bit of context:
    I was previously working with Qt 5.15.2 and compiling with minGW 8.1.0 32-bit. However, the application will use more than 2 Gb in RAM and that's why I would like to build a 64-bits application.

    Right now, I have installed Qt 6.8.1, Qt Creator 15.0.0, MINGW 13.1.0 64-bits.
    The application has some matlab dependencies, which I picked up from the win64 folder: <Matlab_path>\R2022b\bin\win64. Those dll are stored in my libraries folder, and I updated the .pro file accordingly:

    63b162e0-5555-4d44-b21c-7671f05b63d1-image.png

    I can build the application:
    3fbff19b-2a31-4826-9061-92c90197f255-image.png

    bbf95f04-335c-4ccf-907f-ec09395556fb-image.png

    but I can't run it.. I got the error code 0xc000007b which means I am using 32-bits and 64-bits dlls. I tried to understand what is happening and in the project setting I saw this:

    ee6ef1d0-eb31-4d5b-a009-f53f99fa4367-image.png

    I guess it means that Qt is using a 32-bits compiler instead of a 64-bits compiler ?

    When I remove the .pro.user file and try to re open the Qt project, I have this list of kits:
    dcdb04ab-7231-4610-8acc-50ecb2ae1b3c-image.png

    Further information:
    When I installed Qt, I selected manually the components I wanted to install. Maybe I should not have done it.
    I have VS 2022 community installed on my computer.

    Thank you in advance for helping me,

    Have a very nice day guys,

    Pierre-Emmanuel

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Jan 2025, 20:04 last edited by
      #2

      Hi and welcome to devnet,

      AFAIR, that prefix has currently nothing to do with the architecture of the executable itself, it's just a prefix.
      For your issue, I would rather check the PATH environment variable to see if it contains the folder where the 32bit variant of the dlls can be found.
      Check the Run part of the Project panel.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Pierre-Emmanuel
        wrote on 9 Jan 2025, 08:40 last edited by
        #3

        Hi SGaist and thank you for helping me,

        I would rather try to use the 64-bits variant of the matlab dlls. I add a look at the system PATH environment variable and I can see the win64 matlab folder for the different versions of matlab I have installed.

        I was thinking that maybe the compiler I am using (minGW 13.1.0) is different from the one used to compile the matlab dlls.

        Would it be a correct explanation ? But in this case, I don't know which compiler to select in Qt or which one to install.

        About the Run part of the project Panel, this is what I have:
        image.png

        I can't see anything wrong there..

        Have a nice day,
        Pierre-Emmanuel

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Jan 2025, 08:45 last edited by
          #4

          If the mathlab libraries are C libraries, then it doesn't matter which compiler you are using.
          If they are C++, then you have to match. However, since you are successfully building your application, it means you are using the correct libraries. Usually, the DLLs are in the same folder so you should ensure that you have PATH that is pointing to that folder before any other containing mathlab DLLs (or simply remove that folder from PATH in Qt Creator).

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pierre-Emmanuel
            wrote on 9 Jan 2025, 09:16 last edited by
            #5

            Hi SGaist,

            In my PATH environment variable, I have the following matlab folders:
            image.png

            In my project I have this folder tree:
            8a128326-4ad4-44f6-8bb5-892c26c5a77f-image.png

            And in the libraries folder:
            dd3c7723-9172-4f87-8701-b3cc075ed18e-image.png

            And in the .pro file:
            94bbb95c-7565-4075-9b21-ba043aa72abe-image.png

            Would it be better to remove the dll from the libraries folder and modify the .pro file to add the matlab/win64 folder as include path ?
            It will be then machine dependent isn't it ?

            Have a nice day,
            Pierre-Emmanuel

            J 1 Reply Last reply 9 Jan 2025, 09:34
            0
            • P Pierre-Emmanuel
              9 Jan 2025, 09:16

              Hi SGaist,

              In my PATH environment variable, I have the following matlab folders:
              image.png

              In my project I have this folder tree:
              8a128326-4ad4-44f6-8bb5-892c26c5a77f-image.png

              And in the libraries folder:
              dd3c7723-9172-4f87-8701-b3cc075ed18e-image.png

              And in the .pro file:
              94bbb95c-7565-4075-9b21-ba043aa72abe-image.png

              Would it be better to remove the dll from the libraries folder and modify the .pro file to add the matlab/win64 folder as include path ?
              It will be then machine dependent isn't it ?

              Have a nice day,
              Pierre-Emmanuel

              J Offline
              J Offline
              JonB
              wrote on 9 Jan 2025, 09:34 last edited by
              #6

              @Pierre-Emmanuel
              You need to understand the complete difference between linking with libraries at the end of compilation versus loading the libraries at runtime, and I don't think you do.

              Lines like LIBS += -L$$PWD/libraries/ -llibmat in the .pro file are for link time. They look for and use *.lib (for MSVC, or lib*.a for MinGW) files, not *.dll. So the screenshot of your libraries folder showing only .dll files is not relevant or is incomplete. The .lib files must be found for the linking stage to complete successfully.

              But at runtime .lib files are not relevant. Windows looks to load the corresponding .dll files. And those are sought along your PATH. The .pro file is not relevant here. And it looks as though that is finding 32-bit versions of .dll files are being found before 64-bit versions if that is the cause of your error message. You must ensure that is not the case, it must find the desired 64-bit versions of these. Either manipulate your PATH accordingly, or at a pinch you can copy all the desired DLL files into the same directory as the executable, though this is usually done when you package the application for distributuon.

              1 Reply Last reply
              1
              • P Offline
                P Offline
                Pierre-Emmanuel
                wrote on 9 Jan 2025, 11:43 last edited by
                #7

                Hi JonB,

                Thank you for helping me !

                Indeed, I am not really able to understand the difference between linking and loading libraries.

                According to what you wrote, I had a look in the matlab folder to search for .lib files and I found one associated to libmat and libmx dlls. The libraries folder looks like this (the .pro file did not change):
                366d008a-dd1f-4e51-afaa-61e15dd8f369-image.png

                I can compile, but when I try to run the application, I got new error messages:
                7ccef312-9d05-4d0b-b855-b889ff3b6f4f-image.png
                bc9ff9c7-e649-43d5-ad74-0d6a0c9ae78c-image.png

                I re added them to the libraries folder from the matlab folder, but I could not find the associated .lib files. And this time when I try to run the application again, I got the error code as before: 0xc000007b.

                But the dlls are coming from the win64 folder, so they are definitely not 32bit.

                When you say "manipulate your PATH accordingly" is it the system PATH or something related to Qt Creator ?

                Have a nice day,
                Pierre-Emmanuel

                J 1 Reply Last reply 9 Jan 2025, 11:49
                0
                • P Pierre-Emmanuel
                  9 Jan 2025, 11:43

                  Hi JonB,

                  Thank you for helping me !

                  Indeed, I am not really able to understand the difference between linking and loading libraries.

                  According to what you wrote, I had a look in the matlab folder to search for .lib files and I found one associated to libmat and libmx dlls. The libraries folder looks like this (the .pro file did not change):
                  366d008a-dd1f-4e51-afaa-61e15dd8f369-image.png

                  I can compile, but when I try to run the application, I got new error messages:
                  7ccef312-9d05-4d0b-b855-b889ff3b6f4f-image.png
                  bc9ff9c7-e649-43d5-ad74-0d6a0c9ae78c-image.png

                  I re added them to the libraries folder from the matlab folder, but I could not find the associated .lib files. And this time when I try to run the application again, I got the error code as before: 0xc000007b.

                  But the dlls are coming from the win64 folder, so they are definitely not 32bit.

                  When you say "manipulate your PATH accordingly" is it the system PATH or something related to Qt Creator ?

                  Have a nice day,
                  Pierre-Emmanuel

                  J Offline
                  J Offline
                  JonB
                  wrote on 9 Jan 2025, 11:49 last edited by JonB 1 Sept 2025, 11:52
                  #8

                  @Pierre-Emmanuel
                  I can only say what I said before: .lib files are sought at link time, .dll files at runtime. They don't have to be in the same folder. Your .pro file and LIBS += ... says where to search for .lib files at link time, your PATH environment variable (plus the executable directory) says where to search for .dll files. If it links successfully but fails at runtime you can forget about .lib files and look at .dll files, if it fails to link the reverse is the case. If it's generating a runtime error then look through directories in PATH in order to see where it is picking a DLL file from. If that picks up the wrong one then you must either alter PATH to remove that directory or change it to find the right one in an earlier directory on PATH.

                  If you say error 0xc000007b occurs when there is a 32-/64-bit mismatch then somewhere a 16-bit DLL is being picked up.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 9 Jan 2025, 20:04 last edited by
                    #9

                    Just one point that might sound silly: the fact that the folder is named win64 should just be taken as a hint. I would double check that its content really is 64 bit.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    J 1 Reply Last reply 9 Jan 2025, 20:05
                    1
                    • S SGaist
                      9 Jan 2025, 20:04

                      Just one point that might sound silly: the fact that the folder is named win64 should just be taken as a hint. I would double check that its content really is 64 bit.

                      J Offline
                      J Offline
                      JonB
                      wrote on 9 Jan 2025, 20:05 last edited by
                      #10

                      @SGaist Wow, if that's the case..! :)

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        Pierre-Emmanuel
                        wrote on 10 Jan 2025, 09:06 last edited by Pierre-Emmanuel 1 Oct 2025, 09:08
                        #11

                        Hi guys,

                        I tried many things yesterday !

                        First, in the libraries folder there is only the needed .lib files.

                        Then, I added one after the other the missing dlls in the folder where the executable is generated until I get the error code 0xc000007b:
                        48aee9a4-24ec-4bb7-9be0-50541589764c-image.png

                        The for each, I check if they are 32-bits or 64-bits dlls using a git bash:
                        c39744d7-1b69-46d8-a4aa-c30052718628-image.png

                        I don't really know how to interpret the PE32+.. Maybe it is 32-bits dll and that would explain why I can't load ?

                        I compared with the dlls I was using before migrating to a 64-bits toolchain:
                        b6a1f716-04b7-4bdd-8848-4fd6b14a1bb4-image.png

                        Does it means something to you ?

                        I also modified my PATH environment variable like this:
                        bad9b4ff-7614-47be-935e-84ca873e6310-image.png

                        Have a nice day,
                        Pierre-Emmanuel

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          JonB
                          wrote on 10 Jan 2025, 09:31 last edited by
                          #12

                          PE32+ looks right for 64-bit.
                          What exact error message do you get at runtime now? Do you get any clue as to why/where/on what it is happening, like mentioning a DLL it cannot load? If you run it from a debugger do you maybe get any better information?
                          You may have to download and use something like https://github.com/lucasg/Dependencies to examine your .exe/each of the .dlls to discover if there is any 32-bit somewhere. It might be on some DLL indirectly required by another DLL.

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            Pierre-Emmanuel
                            wrote on 10 Jan 2025, 09:53 last edited by Pierre-Emmanuel 1 Oct 2025, 10:00
                            #13

                            Hi JonB,

                            The error popup I got is the following:

                            image.png

                            It does not help at all..

                            Good idea to try to execute it with the debugger ! This is what I got:
                            image.png

                            It's very strange.. It looks like Qt (or Qt Creator) is looking for a file on a different branch (which completely out of the project main folder) of the same project.. But in the .pro file, it is referring only to files in the project.

                            It would be easier if I share the content of the .pro file. I should have done earlier.

                            04cd58b5-bdf6-447b-b7fd-d4a3d02729ba-image.png
                            c8693d10-9bdb-4183-8437-5ee32d1d95c0-image.png
                            062d5366-2bff-46b1-bf75-a22fd010f6ec-image.png
                            4195b43f-206c-45e5-923c-1891e936042a-image.png

                            Obviously, I am cleaning and rebuilding each time I am trying something new.

                            I also has a look at the .pro.user file but there is no reference to "CAN Converter model clone/branches/CAN-4_lbf_asc_extension_support"

                            Have a nice day,
                            Pierre-Emmanuel

                            J 1 Reply Last reply 10 Jan 2025, 10:25
                            0
                            • P Pierre-Emmanuel
                              10 Jan 2025, 09:53

                              Hi JonB,

                              The error popup I got is the following:

                              image.png

                              It does not help at all..

                              Good idea to try to execute it with the debugger ! This is what I got:
                              image.png

                              It's very strange.. It looks like Qt (or Qt Creator) is looking for a file on a different branch (which completely out of the project main folder) of the same project.. But in the .pro file, it is referring only to files in the project.

                              It would be easier if I share the content of the .pro file. I should have done earlier.

                              04cd58b5-bdf6-447b-b7fd-d4a3d02729ba-image.png
                              c8693d10-9bdb-4183-8437-5ee32d1d95c0-image.png
                              062d5366-2bff-46b1-bf75-a22fd010f6ec-image.png
                              4195b43f-206c-45e5-923c-1891e936042a-image.png

                              Obviously, I am cleaning and rebuilding each time I am trying something new.

                              I also has a look at the .pro.user file but there is no reference to "CAN Converter model clone/branches/CAN-4_lbf_asc_extension_support"

                              Have a nice day,
                              Pierre-Emmanuel

                              J Offline
                              J Offline
                              JonB
                              wrote on 10 Jan 2025, 10:25 last edited by JonB 1 Oct 2025, 10:41
                              #14

                              @Pierre-Emmanuel
                              Not sure what this tells us. I think the second error message screenshot is not from the "failure to load" some DLL itself but rather the debugger is trying to fetch the source file for where some error occurred and cannot locate the .cpp source file it wants somewhere inside whatever CAN stuff is all about.

                              I am not a Windows expert so not sure how you proceed. I would probably have a go with the https://github.com/lucasg/Dependencies tool I mentioned to examine the EXE/DLL files I have for their dependencies to see if I could spot something wrong/16-bit. It's probably a good tool to get compiled and working for Windows development in general, so worth spending a few minutes on.

                              P.S.
                              You could Google matlab 0xc000007b. Something like https://stackoverflow.com/questions/6458271/matlab-engine-windows-7-problem says

                              This error is likely due to incorrect installation or multiple installations of Matlab on your machine. Check your Windows %PATH% environment variable [...]

                              Since you used to work with 32-bit matlab perhaps some vestige of this is left around and on your PATH. Check what is in the R2022b\runtime\win64 directory, but also what is in R2022b\bin. Do you need that, or could you remove that? You might try removing both of those from your PATH and resort to copying DLLs one by one from directories to the directory of your executable while you figure out what what exactly it needs to run.

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                Pierre-Emmanuel
                                wrote on 10 Jan 2025, 10:54 last edited by Pierre-Emmanuel 1 Oct 2025, 11:00
                                #15

                                I used the dependencies program to check my application,

                                The first time I got missing dll from Qt6 so I updated the system PATH to have C:\Qt\6.8.1\mingw_64\bin. It fixed all missing dlls related to Qt but still some of them are missing, which seems to be related to Windows:

                                ext-ms-win-oobe-query-11-1-0.dll
                                ext-ms-win32-subsystem-query-11-1-0.dll
                                HvsiFileTrust.dll

                                There is some other missing, which seems to be related to matlab:

                                libmwfl.dll
                                libmwi18n.dll
                                libut.dll
                                libmwcppmicroservices.dll
                                mwboost_log-vc142-mt-x64-1_75.dll
                                CppMicroServices3.dll
                                hdf5-1.8.dll
                                icuuc69.dll

                                I will add them manually.

                                I will also uninstall old matlab version I am not using anymore and see if it change something.

                                Have a nice day,
                                Pierre-Emmanuel

                                J 1 Reply Last reply 10 Jan 2025, 11:02
                                0
                                • P Pierre-Emmanuel
                                  10 Jan 2025, 10:54

                                  I used the dependencies program to check my application,

                                  The first time I got missing dll from Qt6 so I updated the system PATH to have C:\Qt\6.8.1\mingw_64\bin. It fixed all missing dlls related to Qt but still some of them are missing, which seems to be related to Windows:

                                  ext-ms-win-oobe-query-11-1-0.dll
                                  ext-ms-win32-subsystem-query-11-1-0.dll
                                  HvsiFileTrust.dll

                                  There is some other missing, which seems to be related to matlab:

                                  libmwfl.dll
                                  libmwi18n.dll
                                  libut.dll
                                  libmwcppmicroservices.dll
                                  mwboost_log-vc142-mt-x64-1_75.dll
                                  CppMicroServices3.dll
                                  hdf5-1.8.dll
                                  icuuc69.dll

                                  I will add them manually.

                                  I will also uninstall old matlab version I am not using anymore and see if it change something.

                                  Have a nice day,
                                  Pierre-Emmanuel

                                  J Offline
                                  J Offline
                                  JonB
                                  wrote on 10 Jan 2025, 11:02 last edited by JonB 1 Oct 2025, 11:05
                                  #16

                                  @Pierre-Emmanuel
                                  I will just say you may be disappearing down a rabbit hole. I think some of these might be "false negatives" reported by the tool, e.g. see https://www.reddit.com/r/AskProgramming/comments/xxzpfk/reputable_sources_for_missing_dlls/ has a couple of yours, I don't know.

                                  Maybe it's time for you to find a matlab forum and ask for help/clues/pointers there for whatever your issue is?

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    Pierre-Emmanuel
                                    wrote on 10 Jan 2025, 11:13 last edited by
                                    #17

                                    I think it is yes,

                                    Thank you JonB and SGaist for helping me.

                                    I will keep posting here if I have more details or more founding !

                                    1 Reply Last reply
                                    1
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 10 Jan 2025, 20:38 last edited by
                                      #18

                                      What I would do is to empty the PATH environnement variable in Qt Creator and add yourself what is required for your application to work so it only contains entries pertinent to your application just to be sure there's no other DLLs found beside the ones your really need.

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      1
                                      • P Offline
                                        P Offline
                                        Pierre-Emmanuel
                                        wrote on 20 Jan 2025, 10:23 last edited by
                                        #19

                                        Hi SGaist,

                                        Sorry I come back to this topic quite late.
                                        I asked the question HERE on the matlab forum.

                                        I have tried clearing the PATH environment variable from Qt Creator by checking "Clear System environment" checkbox:
                                        921a43d2-333e-4139-9414-a15cc8271a18-image.png

                                        But then I got new issues to build the app like:
                                        1e67a33d-b2c1-4c89-b383-f26c17b8e439-image.png

                                        I guess I need to keep some environment variables ?

                                        Thank you for you help,
                                        Have a nice day,

                                        Pierre-Emmanuel

                                        jsulmJ 1 Reply Last reply 20 Jan 2025, 10:26
                                        0
                                        • P Pierre-Emmanuel
                                          20 Jan 2025, 10:23

                                          Hi SGaist,

                                          Sorry I come back to this topic quite late.
                                          I asked the question HERE on the matlab forum.

                                          I have tried clearing the PATH environment variable from Qt Creator by checking "Clear System environment" checkbox:
                                          921a43d2-333e-4139-9414-a15cc8271a18-image.png

                                          But then I got new issues to build the app like:
                                          1e67a33d-b2c1-4c89-b383-f26c17b8e439-image.png

                                          I guess I need to keep some environment variables ?

                                          Thank you for you help,
                                          Have a nice day,

                                          Pierre-Emmanuel

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on 20 Jan 2025, 10:26 last edited by
                                          #20

                                          @Pierre-Emmanuel said in Qt 64 bits application:

                                          by checking "Clear System environment" checkbox

                                          Why? Only change PATH, nothing else.

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

                                          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