Adding a manifest to gcc-compiled .dll that links to msvcr90

November 10, 2010 by
Filed under: Notes 

First, create a manifest file, called $(DLLNAME).dll.manifest
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="*" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

Then make a small $(DLLNAME).rc file:

#include "winuser.h"
2 RT_MANIFEST "$(DLLNAME).dll.manifest"

Then compile this using windres in Makefile:

WINDRES = windres.exe
$(WINDRES) --input $(DLLNAME).rc --output $(DLLNAME).o --output-format=coff

and link as usual:

$(BIN): $(OBJ) $(DLLNAME).o

Thanks to this site and this one.


Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!