Reputation: 1069
i am using vs2010 and whenever i build any windows application (not using mfc or standard library -only raw api) msvcrt.dll gets linked to it. There are plenty of apps out there which are compiled on vs but does not have this dependency.
How to remove msvcrt.dll dependency from my application.
Upvotes: 4
Views: 1873
Reputation: 613202
That's the C runtime library and you can't build a C++ program without a runtime.
For Visual Studio 2010 you would have msvcr100.dll linked in fact since that is the MSVC runtime for that version of the compiler. Plain old msvcrt.dll is the MSVC6 runtime which is now shipped as a Windows system component. If your executable is linking to msvcrt.dll then you must be linking to something else that in turn links to msvcrt.dll since nothing in VS2010 will take a dependency on the MSVC6 runtime.
You can remove the dependency on msvcr100.dll by using static linking (/MT) but there are pros and cons of choosing that option. If you use static linking then you can distribute your application as a single executable. If you use dynamic linking then you have to install the runtime on each target machine. Using certain third party libraries will force you to use dynamic linking so that the runtime can be shared between your executable and the third party libraries.
Upvotes: 7