I found this a while ago (on an SAP mailing list, if I recall
correctly) and I thought I share this.
When compiling native extensions on windows using Visual Studio 2005,
loading the resulting library results in an ungly Runtime Error.
This seems to be caused by some information missing from the library,
which is included automatically when using VC6. To fix this problem,
mt.exe -outputresource:extension_name.so;2 -manifest
Replacing extension_name with the correct extension name, of course.
I have modified my mkmf.rb file to include this line:
mfile.print “\n\tmt.exe -outputresource:$(DLLIB);2 -manifest
$(DLLIB).manifest” if $mswin
So far, I have tested this for some of my own extensions, as well as
ruby-debug. I also use it to try and compile the Ferret c extension,
but am having some problems - but those are caused by problems with
the Ferret code itself, not the extension loading mechanism.