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.
Is there's a way to statically link vs 2010 runtime dlls?
In the project properties, go to Configuration Properties, C++ and Code Generation, and change the Runtime Library option to a non-DLL runtime.
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.
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.
Thx for the tip but, I will never,never,never,never,never,never,never,never,never,never use mfc
NEVER !!
"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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement