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. Compile in release build with .dll files
Forum Updated to NodeBB v4.3 + New Features

Compile in release build with .dll files

Scheduled Pinned Locked Moved General and Desktop
10 Posts 4 Posters 20.4k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    browser90
    wrote on last edited by
    #1

    Hi guys,

    I've been searching on google for the method to make the exe with all the .dll files because when I select release mode now and compile the project, the .exe can't open because of missing .dll's.

    On the internet they say you can compile via static libs and stuff but it doesn't work, all the settings they don't compile it so I can run without it.

    Can someone give me a good tutorial?

    Kind regards,

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      you can check these "tutorials":http://www.voidrealms.com/viewtutorial.aspx?id=243 . There are other tutorials as well in the same website tutorial 97,98 and 99.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        browser90
        wrote on last edited by
        #3

        that's how to create a .dll file. But I've got a UI application that I want to release to give it to a friend, but then I need to search for every dll that the program uses, like opengl4.dll (.dll file from qt), and more and more.. Is there a way that it build the app so I can just give the exe or that it sets the .dll in the release map so I don't need to search it?

        Kind regards, and thanks for your help.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #4

          AFAIK you need to copy the .dll files along with the exe. Otherwise you can create a static library. Check "this":http://www.voidrealms.com/viewtutorial.aspx?id=245

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MuldeR
            wrote on last edited by
            #5

            [quote author="browser90" date="1338203566"]I've been searching on google for the method to make the exe with all the .dll files because when I select release mode now and compile the project, the .exe can't open because of missing .dll's.[/quote]

            The DLL files that your EXE file depends on need to be located at one of the places that Windows will seach, according to the DLL Search Order. Please have a look at the following MSDN article:

            http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#search_order_for_desktop_applications

            It's probably the easiest to install them to the same folder where the EXE file is located :-)

            And don't forget to install the Visual C++ Runtime Libraries that may be needed for files compiled with VS2008/VS2005. If you use VS2010, you can simply put the CRT DLL's into the install folder.

            You may also want to use Dependency Walker to check which DLL's your EXE file actually needs:
            http://www.dependencywalker.com/

            [quote author="browser90" date="1338203566"]On the internet they say you can compile via static libs and stuff but it doesn't work, all the settings they don't compile it so I can run without it.[/quote]

            You can compile Qt as static lib's. But you have to do it yourself, because the official release only contains the DLL version. You will also need to set the QT_NODLL macro when compiling your app with the static libs.

            My OpenSource software at: http://muldersoft.com/

            Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

            Go visit the coop: http://youtu.be/Jay...

            1 Reply Last reply
            0
            • B Offline
              B Offline
              browser90
              wrote on last edited by
              #6

              Thanks for your help, I've downloaded dependencywalker and downloaded every dll that it needed but now it sais errors like "can't find accesspoint of procedure QtCore4.dll" ...

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MuldeR
                wrote on last edited by
                #7

                [quote author="browser90" date="1338213777"]Thanks for your help, I've downloaded dependencywalker and downloaded every dll that it needed but now it sais errors like "can't find accesspoint of procedure QtCore4.dll" ...[/quote]

                First of all, you shouldn't have to download any DLL separately. The Qt libraries are included with the [url=http://qt-project.org/downloads]Qt SDK[/url] download. You should find them in the "bin" folder. Furthermore it seems you are using an incompatible DLL that is missing a required entry point. Downloading an arbitrary version of the Qt DLL's somewhere from the net may not work, because the DLL version has to match (or at least be compatible to) the version of Qt that was used to build your application. So this error is not a big surprise. Simply use the DLL's that are included with the Qt SDK that you are using to build your EXE file and you should be fine! Other than that, you shouldn't need any additional DLL's - except for the Visual C++ Runtime (CRT) libs. And even that only if you build with VisualStudio...

                Warning: In Dependency Walker, check carefully from where (full path!) your EXE is loading the DLL's. It can happen that your Qt DLL's aren't used at all, e.g. because you put them to a "wrong" place. In that case, Windows will search for the needed DLL's according to the DLL Search Order in various places (see my previous post!). It then may find (and try to use!) some Qt DLL's that another application left behind on your system...

                Warning 2: The Qt DLL's for Windows exist in two flavors: MSVC and MinGW/GCC. You have to use the DLL's that match your compiler! If, for example, you build with VisualStudio, then your EXE will need the MSVC variant of the Qt DLL's. It's not possible to use the MinGW/GCC DLL's with MSVC-compiled EXE files (or vice versa).

                My OpenSource software at: http://muldersoft.com/

                Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                Go visit the coop: http://youtu.be/Jay...

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sandeep123
                  wrote on last edited by
                  #8

                  Hi i need to show the C++ program in a release version could you help me, how to create an executable file for that.

                  [quote author="MuldeR" date="1338210148"][quote author="browser90" date="1338203566"]I've been searching on google for the method to make the exe with all the .dll files because when I select release mode now and compile the project, the .exe can't open because of missing .dll's.[/quote]

                  The DLL files that your EXE file depends on need to be located at one of the places that Windows will seach, according to the DLL Search Order. Please have a look at the following MSDN article:

                  http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#search_order_for_desktop_applications

                  It's probably the easiest to install them to the same folder where the EXE file is located :-)

                  And don't forget to install the Visual C++ Runtime Libraries that may be needed for files compiled with VS2008/VS2005. If you use VS2010, you can simply put the CRT DLL's into the install folder.

                  You may also want to use Dependency Walker to check which DLL's your EXE file actually needs:
                  http://www.dependencywalker.com/

                  [quote author="browser90" date="1338203566"]On the internet they say you can compile via static libs and stuff but it doesn't work, all the settings they don't compile it so I can run without it.[/quote]

                  You can compile Qt as static lib's. But you have to do it yourself, because the official release only contains the DLL version. You will also need to set the QT_NODLL macro when compiling your app with the static libs.[/quote]

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sandeep123
                    wrote on last edited by
                    #9

                    Hi i need to show the C++ program in a release version could you help me, how to create an executable file for that.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sandeep123
                      wrote on last edited by
                      #10

                      Please let me know if any one could help me. I was trying to make it but few unknow exceptions i couldn't solve.
                      my id: ksandeepvarma1@gmail.com

                      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