Compile in release build with .dll files
-
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,
-
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.
-
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.
-
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
-
[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:
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.
-
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 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).
-
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:
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]
-
Hi i need to show the C++ program in a release version could you help me, how to create an executable file for that.
-
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