Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio C++ - How to avoid Visual C++ Redistributable Packages? [duplicate]

When I run my program on a freshly installed computer, it tells me that Visual C++ Redistributable Package 2015 (namely, MSVCP140.dll) needs to be installed on the computer in order to run my dynamically linked program.

I understand that static linking would solve the problem - however, that just doubles the size of my executable.

Isn't there a way to suppress visual studio features so the redist package is not necessary and still use the visual studio compiler, as I'm not used to the alternatives like mingw etc.

Or does the redist package actually contain the STL? I can hardly imagine that.

like image 990
user66875 Avatar asked Nov 16 '25 09:11

user66875


1 Answers

AFAIK you only have 2 options : 1. static linking - no dll dependency, but huge size 2. dynamic linking - you need correspond dlls , relativelly small executables.

As for #2 you also have 2 options :

  1. install redist as standalone package
  2. put this dll's in same directory with exe . It's "legal" from MS stand point. (privat assembly ?)

Hope it helps .

like image 111
user1503944 Avatar answered Nov 18 '25 16:11

user1503944



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!