Jano Svitok
12/24/2006 1:45:00 PM
On 12/24/06, crysknife@gmail.com <crysknife@gmail.com> wrote:
> So, I'm writing a program which uses SWIG to interface between C++ and
> Ruby, and I just upgraded my Ruby version from an older version (I
> think 1.8.2) to the current stable release (1.8.5). Now when I compile
> (in MSVS2003) I receive "fatal error C1189: #error : MSC version
> unmatch" from Ruby's config.h, from these lines:
> #if _MSC_VER != 1200
> #error MSC version unmatch
> #endif
> If I comment out these lines, I then get errors from ostream and
> istream:
> ostream(491) : warning C4003: not enough actual parameters for macro
> 'write'
> ostream(490) : error C2059: syntax error : ')'
> and so on.
You're facing two issues:
1. compiling extension with another compiler than ruby was compiled with.
2. 1.8.5 has problems with stl, namely iostrem.
1. You may be lucky, and it might work. Just comment out the check.
DANGER!!! You may encounter strange bugs if you try! That being said,
for me it worked somehow (ruby VC6, ext VC8) - my extension is a
really thin layer that just copies memory chunks back and forth. I'm
not sure what the dangerous areas are, I remember hearing something
about files and errno.
If you can't compile your extension with VC6 or mingw, compiling ruby
+ oneclick installer with VC8 is a matter of a few hours. (I didn't
test too extensively the result, though). Just download the ruby
source tarball, read the readme in win32 dir, set your paths and start
whatever the readme tells you. One-click the same - checkout/export
trunk, and follow the readme. I had to download some things manually
from other sources, as their main site didn't work that time.
2. I had a similar problem. I got around it by #undef'ing write and
read before I #included <iostream>
Now that I think of it, I should have filed a bug... I have just done
that: #7431.