Article Last Modified on 28-May-2008
I have built an XLL using MFC libraries and Visual Studio 2005. If I deliver it to a user's machine, it requires the MFC runtime DLLs. These have to be installed by an administrator, which is not always permitted or convenient. How can I produce an XLL which uses MFC but does not need run-time libraries?
Note that the MFC minimum-dependency libraries are only available for licensed users. To download them from our web-site, you will need to have registered a license for XLL+ for VS2005.
The download can be found on our Downloads page. The file to download is named "MFC Minimum-dependency libraries for XLL+ 5/VS2005".
Open the project properties window for your project, and change the following settings. Note that some of the settings vary for the Debug and Release builds.
In the General tab, set Use of MFC to "Use MFC in a Static Library".
In the C/C++ Preprocessor tab, select Preprocessor Definitions and
In the C/C++ Code Generation tab, set Runtime Library to "Multi-threaded Debug (/MTd)" (for Debug builds) or "Multi-threaded (/MT)" (for Release builds).
In the Linker Input tab, select Additional Dependencies and add
xlllibdi.lib (for Debug builds) or
(for Release builds).
Before you deploy your XLL, use the Dependency Walker to inspect it for any
other dependencies. This tool is delivered as depends.exe, and is part of
Visual Studio and can be found in
Common7\Tools\Bin under the
Visual Studio 2005 installation folder.