1

I am working with C++ for a project and using the Qt framework to help me out. However, I am dealing with some annoying issues and I hope someone can help me out here. Here's what I have so far"

  • I created my C++ application using Qt
  • Compiled my application and send out the final .exe file

I also installed a separate non-developmental OS to test my application. On the test OS I just had to install the Qt libraries and my application would run just fine.

But some of the users of my application are having trouble running the application. Some of them installed Qt but the application still cannot find the required .dll files or if they installed Qt fine the application still fails because Qt itself has some other dependency. Or they are on a 64 bit but my application is 32-bit... so their 64 bit Qt library does not work with my application.

So, what I am thinking of doing is basically get a tree of all the .dll files my application will need to run smoothly and include all of them as part of my .exe application.

Certainly the file size will increase but at least I will have the peace of mind knowing that the application has everything it needs.

I am reading more about Static/Dynamic Linking etc... but in the C++ world it is a bit different. Is there a system in C++ that is similar to Java where you specify the libraries and during compilation C++ would copy the necessary libraries to the end product?

roosevelt
  • 1,874
  • 4
  • 20
  • 27

2 Answers2

0

dependency walker will show you all needed DLLs you need to pass them along as well

people generally use a packager for this, with which you can also set up environment variables and fiddle with the registry

ratchet freak
  • 47,288
  • 5
  • 68
  • 106
0

You should place Qt DLLs along the release version of your executable. These are QtCore4.dll, QtGui4.dll (Qt5Core.dll, Qt5Gui.dll,... for Qt5) and possibly the ones for other modules that you have used. These dll files are in your installed Qt Directory in bin folder.

You should also place msvcr100.dll and msvcp100.dll in case you are using MSVS2010.

If you are using plugins you should place their dll in a folder named "plugins" beside youe exe. In case of using icons and images you should ship their dlls like qico4.dll and qsvg4.dll (qico.dll and qsvg.dll for Qt5) in a folder named "imageformats".

Nejat
  • 31,784
  • 12
  • 106
  • 138