When I Googled for building Ruby extensions for Windows, I found a lot of old (very old) information. I found some good info at this web site. What follows is a record of my attempts to follow this guidance.
- Download and install Visual C++ 2005 Express Edition (free)
- Download and install the Platform SDK (ISO Edition) from Microsoft.
- I installed none of the 64–bit stuff — mostly just the 32–bit Intel core SDK
- Edit $RUBY_HOME/lib/ruby/1.8/i386-mswin32/config.h and delete the “#error MSC version unmatch” line
- Click your way to:
- Start
- All Programs
- Microsoft Platform SDK…
- Open Build Environment Window
- Windows XP 32–bit Build Environment
- Set Windows XP…(Retail)
- cd "C:\Program Files\Microsoft Visual Studio 8\VC\bin"
- The quotes are important.
- vcvars32.bat
- cd C:\temp\guitest\ext\cguitest
- I'm building the guitest extension
- ruby extconf.rb
- nmake
- mt.exe -manifest my_test.so.manifest -outputresource:my_test.so;2
- Copy and paste the command above. You need it all from the 'mt' to the ';2'
- nmake install
- cd \temp\guitest
- ruby install.rb install
- irb
- require 'win32/guitest'
- Happiness