Thursday, February 2, 2012

Getting Qt 4.6.4 to Work with Ruby 1.9.3 On Windows 7

I had a lot of trouble getting Qt 4.6.4 to run with Ruby 1.9.3, even with some of the guides online. I had to take information from multiple sources and even then, it still didn't work. This is the full set of steps that I followed in order to get it set up on my two Windows 7 machines.
  1. Install Ruby 1.9.3 from rubyinstaller.org
  2. Install MinGW sufficient to install qt-win-opensource-4.6.4-mingw.exe. I installed the Qt SDK from the Web Installer.
  3. Add MinGW\bin to your path.
  4. Add Ruby193\bin to your path.
  5. Install Qt 4.6.4 Libraries for Windows (MinGW 4.4) (qt-win-opensource-4.6.4.exe)
  6. Run gem update --system
  7. Run gem install qtbindings
  8. Copy Qt\4.6.4\bin\Qt*.dll to Ruby193\bin
  9. Run ruby yourprogram.rb
Your program's contents should be something like:
require 'rubygems'
require 'Qt'
app = Qt::Application.new ARGV
frame = Qt::Widget.new
frame.show
app.exec

No comments:

Post a Comment