Hello,
I wrote a dll in VS2008 that I use in my C# application,but my users don't like the fact they need both .NET framework and VC++ Runtime.
Is there a way I could avoid the 'must-have' VC++ Runtime in my C++ dll?
Hello,
I wrote a dll in VS2008 that I use in my C# application,but my users don't like the fact they need both .NET framework and VC++ Runtime.
Is there a way I could avoid the 'must-have' VC++ Runtime in my C++ dll?
You can link the static runtime library into your dll. This way it will always be there and no .dll with C++ runtime will be required.
You can build your dll with the runtime linked statically (/MT instead of /MD - Under properties->Configuration Properties->C/C++->Code Generation->Runtime Library).
Like others said, you can statically link, but that will become a nightmare if you ever incorporate 3rd party C++ dlls that are not statically linked (which is almost everything). That scenario will lead to random crashes that will take you forever to debug. The easiest thing to do is to use an installer which hides this from your users. You can use merge modules if you use the vs installer, or install as part of an nsis install. This will make everyone's life easier. Especially yours. There is no reason on should be against installing these anymore than one is against installing the .NET framework. It makes no difference in terms of stability unless you need them and don't have them.