You are viewing a read-only archive of the Blogs.Harvard network. Learn more.
Skip to content

Getting a ruby C extension to compile on Windows Part 2

In a previous post I mentioned how to get the Ruby C extension to compile under Windows using Visual Studio Express/Studio 2005. However, I left out an important part regarding manifests which have been part of the development process in VC++7 and above.

Manifests are some XML representation of the bindings and and activation (whatever that means) for many things such as classes, libraries, and assemblies. It boils down to you need one if you’re going to deploy a library (DLL) or executable (EXE) made with VC++ 2005. The manifests by default will go into a file called .manifest however for our purposes we will need to embed it into the library (in this case it is a .so not a .dll).

Here’s the howto:

C:\exttest>mt.exe -manifest my_test.so.manifest -outputresource:my_test.so;2
C:\exttest>nmake install
C:\exttest>irb
irb(main):002:0> require 'my_test'
=> true
irb(main):003:0>

The main thing you need to remember is (don’t forget the 2!!)
mt.exe -manifest my_lib_name.so.manifest -outputresource:my_lib_name.so;2

Resources

Be Sociable, Share!