Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running .exe without copying .dlls

I have Visual Studio 2015 solution ready for delivery. I have a requirement that the .exe should run out of the box. However, I am getting "missing dll..." errors. Is there any way I could make it possible for someone to run the exe without him needing to download bunch of ddls? Can I build the .exe to be executable as stand-alone somehow?

like image 714
omegasbk Avatar asked Mar 10 '16 22:03

omegasbk


1 Answers

Yes, you have to statically link the binary. In the project settings (Configuration Properties -> C/C++ -> Code Generation), use /MT, /MTd for the Release, Debug configurations respectively. However, this bloats the size of the executable.

MSDN documentation on /MT, /MTd options

like image 177
Mahesh Avatar answered Nov 06 '22 05:11

Mahesh