Sign in to follow this  

Is there's a way to statically link vs 2010 runtime dlls?

This topic is 1776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if there was a way do statically link those 2 dlls you need for a vs 2010 application to work on someone's else machine if they don't have the runtime installed. That would make my life a bit easier, thx.

Edited by jbadams
Restored post contents from history.

Share this post


Link to post
Share on other sites

In the project properties, go to Configuration Properties, C++ and Code Generation, and change the Runtime Library option to a non-DLL runtime.

Share this post


Link to post
Share on other sites

Thx ill give it a try

Edited by jbadams
Restored post contents from history.

Share this post


Link to post
Share on other sites
You may also need to set "Configuration Properties -> General -> Use of MFC" to "Use MFC in a Static Library".
Note that this doesn't only apply when you are actually using MFC yourself. It quite often applies when something you're using uses MFC itself internally I believe.
Sometimes you even need to do the same for the ATL setting right below that, IIRC.

If in doubt, Use the program "Depends.exe" before and after making these changes, to see what DLLs your program actually requires, and prove that you've removed the unwanted dependencies.

Share this post


Link to post
Share on other sites

Thx for the tip but, I will never,never,never,never,never,never,never,never,never,never use mfc

 

NEVER !!

Edited by jbadams
Restored post contents from history.

Share this post


Link to post
Share on other sites

"Never" is a very long time.

 

Despite that, the point iMalc was making was that you may not be using MFC, but some other library that you're linking to may be using it behind your back, although I believe that the static vs dynamic usage of MFC would in that case depend on the project settings used for building that other library, not for your program.

Share this post


Link to post
Share on other sites
I once found it out in desparation, and have confirmed it several times since, that setting it to "Use MFC in a Static Library", removes some dependencies on other DLLs, and no I never use MFC either. If you still have unwanted dependencies, it cant hurt to try it out.

Share this post


Link to post
Share on other sites
Sign in to follow this