Summary
I'm writing a Ruby 1.9.2 app using Qt4 for its GUI which I want to distribute on Linux, OS X and Windows. I have the app running fine on everything except my Windows 7 64-bit box.
There are working examples of Win7 + Qt4 + 1.8.7, but apparently not Win7 + Qt4 + 1.9.2. There are two gems for Ruby-Qt bindings, qtbindings
and qtruby4
(sometimes referred to as qt4-qtruby
), but I have not yet seen either of them running on Win7 with Ruby 1.9.2.
The Problem With qtruby4
This article from October 2008 and its updated version from June 2011 served as good starting points, but I differed from the latter by installing Ruby 1.9.2 via RubyInstaller for Windows' download page. 1.8.7 seemed to work fine, but I get some unusual errors when I try it with 1.9.2. Requiring 'rubygems'
and then requiring 'Qt'
results in:
no such file to load -- 'qtruby4'
The first article from above links to a more in-depth article from dr1ku which may provide some clues.
- It might be worth reproducing dr1ku's steps with the latest versions of these libraries.
- dr1ku and the 2008 paschenda.org article both use a special Windows Qt4-QtRuby installer, but the maintainer notes that he hasn't had the time to update it. I'm not completely clear on what the special installer does, but I suppose paschenda.org's 2011 article no longer uses it because DevKit ostensibly helps RubyGems itself build Qt4 without assistance.
Found in the Wild
Here are some people who appear to be have encountered the same problem:
- no qtruby library on windows
- Ruby 1.9.x + Qt4Ruby…. a pipe dream???
- qtruby4 LoadError in ruby 1.9.1 / win32 for qtruby4-2.1.0
The Problem With qtbindings
My app actually uses the qtbindings
gem, so I tried installing that instead, with gem install qtbindings --platform=mswin32
.[1] However, when I tried to require 'Qt'
with the qtbindings
gem installed, I got a Windows popup with the following message:
The procedure entry point
_Z10qvsnprintfPcjPKcS_
could not be located in the dynamic link library QtCore4.dll. Just give up, inferior flesh creature.
(I have copy and pasted the message without any embellishment whatsoever.)
Found in the Wild
Here are some people who appear to be have encountered the same problem:
Potential Success Stories
Someone out there seems to have had success by installing the qtbindings
gem on 1.9.2 with gem install qtbindings
(no --platform
argument), if you look at the replies to this thread:
I tried installing with gem install qtbindings
on 1.8.7, but I have not tried it with 1.9.2 yet. When I tried it with 1.8.7, I ran into the same "procedure entry point could not be located" issue as before.
Footnotes
[1] - I'm actually not completely clear on the difference between the qtbindings
gem and the qtruby4
gem. For example, does the latter include the C extension and the former does not? I'm not sure. Additionally, I have seen references to qt4-qtruby
, which I think is just the mswin32 version of qtruby4
, at least as far as I can tell from the Korundum download page.
require 'Qt'
, so even a 4-line example would be overkill. This is all you need in a file to see the issue:require 'rubygems'; require 'Qt'
– MceachernMSVCRT.DLL
from Microsoft for the run-time C library, and perhaps it isn't installed with the 1.9.2 Ruby install? – Proportionatevsnprintf
mangled function. What doesldd
output on all the libraries involved look like? – Proportionateldd
provided by DevKit on Windows? Otherwise I'm not aware of how to set it up properly. – Mceachernldd
to work -- I don't know the Windows-native equivalent, sorry, but surely there is something that can report object file requirements and report back which ones are unsatisfied. – Proportionate