1

I would like to create an executable file from my VS project which relies on some tools of my camera, Qt and OpenCV.

The executable can be found via the release, but as soon as I put the exe file in another machine: lots of dll error messages are mentioned.

Any idea / good guidelines to create an exe file?

MelMed
  • 255
  • 10
  • 19

2 Answers2

1

When you build your exe file it does embed only static libraries, dynamic libraries are linked at runtime and you need to ensure that they are available on each "machine" you want your program to run.

You have to put necessary dll in the same directory of your executable and distribute them together.

The Visual Studio dll's are installed via the Microsoft Visual C++ Redistributable Package of your Visual Studio version.

System dll should already be present on the machine and if not, you have to build a new executable compatible to that machine.

Enjoy fantastic dll world !

FRHU
  • 26
  • 1
  • I am using a Qt add in for my VS. I will just have to include all Dll files of Qt and OpenCV that I was using in my release folder? – MelMed Jul 19 '13 at 08:29
  • Yes you need at least the QtCoreX.dll and QtGuiX.dll plus the dll of the other modules you're using(ex. QtSvgX.dll) – FRHU Jul 19 '13 at 08:47
0

Please have a look here: Create a self-contained program in C++ I think it gives a good overview on how to make a self-contained executable.

Alternatively, you can take the needed dll-s with you (most programs do it).

Community
  • 1
  • 1